From 086289520dcf3e0a7bc2cf818bbb7f202b95b370 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 29 Nov 2022 01:23:38 +0100 Subject: [PATCH 01/78] feat: porting code from old branch --- NorthstarDLL/NorthstarDLL.vcxproj | 4 + NorthstarDLL/NorthstarDLL.vcxproj.filters | 10 +- NorthstarDLL/verifiedmods.cpp | 195 ++++++++++++++++++++++ NorthstarDLL/verifiedmods.h | 4 + 4 files changed, 211 insertions(+), 2 deletions(-) create mode 100644 NorthstarDLL/verifiedmods.cpp create mode 100644 NorthstarDLL/verifiedmods.h diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj index 57ffb9ad9..d3fc2e1fd 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj +++ b/NorthstarDLL/NorthstarDLL.vcxproj @@ -563,6 +563,7 @@ + @@ -643,6 +644,9 @@ + + false + diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters index 164d80b8f..68e2e4c15 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj.filters +++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters @@ -1490,7 +1490,7 @@ Header Files\Squirrel - + Header Files @@ -1499,10 +1499,13 @@ Header Files\Console - + Header Files\Squirrel + + Header Files + @@ -1730,6 +1733,9 @@ Source Files\Console + + Source Files\Client\Scripted + diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp new file mode 100644 index 000000000..05baa19f4 --- /dev/null +++ b/NorthstarDLL/verifiedmods.cpp @@ -0,0 +1,195 @@ +#include "pch.h" +#include "masterserver.h" +#include "rapidjson/document.h" +#include "rapidjson/writer.h" +#include "rapidjson/stringbuffer.h" +#include "squirrel.h" +#include "verifiedmods.h" + +using namespace rapidjson; + +Document verifiedModsJson; + +// Test string used to test branch without masterserver +const char* modsTestString = + "{" + "\"Dinorush's LTS Rebalance\" : {\"DependencyPrefix\" : \"Dinorush-LTSRebalance\", \"Versions\" : []}, " + "\"Dinorush.Brute4\" : {\"DependencyPrefix\" : \"Dinorush-Brute4\", \"Versions\" : [ \"1.5\", \"1.6\" ]}, " + "\"Mod Settings\" : {\"DependencyPrefix\" : \"EladNLG-ModSettings\", \"Versions\" : [ \"1.0.0\", \"1.1.0\" ]}, " + "\"Moblin.Archon\" : {\"DependencyPrefix\" : \"GalacticMoblin-MoblinArchon\", \"Versions\" : [ \"1.3.0\", \"1.3.1\" ]}" + "}"; + +void _FetchVerifiedModsList() +{ + spdlog::info("Requesting verified mods list from {}", Cvar_ns_masterserver_hostname->GetString()); + + std::thread requestThread( + []() + { + CURL* curl = curl_easy_init(); + + std::string readBuffer; + curl_easy_setopt(curl, CURLOPT_URL, fmt::format("{}/client/verifiedmods", Cvar_ns_masterserver_hostname->GetString()).c_str()); + curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); + + // TODO fetch list from masterserver + verifiedModsJson.Parse(modsTestString); + return; + + CURLcode result = curl_easy_perform(curl); + spdlog::info(result); + + if (result == CURLcode::CURLE_OK) + { + spdlog::info("curl succeeded"); + + verifiedModsJson.Parse(readBuffer.c_str()); + + if (verifiedModsJson.HasParseError()) + { + spdlog::error("Failed reading masterserver verified mods response: encountered parse error."); + goto REQUEST_END_CLEANUP; + } + if (!verifiedModsJson.IsObject()) + { + spdlog::error("Failed reading masterserver verified mods response: root object is not an object"); + goto REQUEST_END_CLEANUP; + } + if (verifiedModsJson.HasMember("error")) + { + spdlog::error("Failed reading masterserver response: got fastify error response"); + spdlog::error(readBuffer); + if (verifiedModsJson["error"].HasMember("enum")) + spdlog::error(std::string(verifiedModsJson["error"]["enum"].GetString())); + else + spdlog::error(std::string("No error message provided")); + goto REQUEST_END_CLEANUP; + } + } + else + { + spdlog::error("Failed requesting verified mods list: error {}", curl_easy_strerror(result)); + } + + REQUEST_END_CLEANUP: + curl_easy_cleanup(curl); + }); + requestThread.detach(); +} + +std::string GetVerifiedModsList() +{ + if (verifiedModsJson.IsNull()) + { + _FetchVerifiedModsList(); + + while (verifiedModsJson.IsNull()) + { + spdlog::info("Wait for verified mods list to arrive..."); + Sleep(2000); // TODO do this asynchronously to avoid blocking the thread + } + + spdlog::info("Verified mods list arrived."); + } + + StringBuffer buffer; + Writer writer(buffer); + verifiedModsJson.Accept(writer); + return buffer.GetString(); +} + +/** + * Checks if a mod is verified by controlling if its name matches a key in the verified mods JSON + * document, and if its version is included in the JSON versions list. + */ +bool IsModVerified(char* modName, char* modVersion) +{ + // 1. Mod is not verified if its name isn't a `verifiedModsJson` key. + if (!verifiedModsJson.HasMember(modName)) + { + spdlog::info("Mod \"{}\" is not verified, and thus couldn't be downloaded.", modName); + return false; + } + + // 2. Check if mod version has been validated. + const Value& entry = verifiedModsJson[modName]; + GenericArray versions = entry["Versions"].GetArray(); + + spdlog::info("There's an entry for mod \"{}\", now checking version...", modName); + + for (rapidjson::Value::ConstValueIterator iterator = versions.Begin(); iterator != versions.End(); iterator++) + { + const rapidjson::Value& version = *iterator; + if (strcmp(version.GetString(), modVersion) == 0) + { + spdlog::info("Mod \"{}\" (version {}) is verified.", modName, modVersion); + return true; + } + } + + spdlog::info("Required version {} for mod \"{}\" is not verified, and thus couldn't be downloaded.", modVersion, modName); + return false; +} + +void DownloadMod(char* modName, char* modVersion) +{ + if (!IsModVerified(modName, modVersion)) + return; + + // TODO check if mod is already present + // TODO check if mod is verified (throw if not) + // TODO download zip in temporary folder + // TODO move mod to mods/ folder +} + +/** + * Squirrel-exposed wrapper methods + **/ + +ADD_SQFUNC("string", GetVerifiedModsList, "", "", ScriptContext::UI) +{ + std::string mods = GetVerifiedModsList(); + const SQChar* buffer = mods.c_str(); + g_pSquirrel->pushstring(sqvm, buffer, -1); + return SQRESULT_NOTNULL; +} + +/* +* TODO TEST BEFORE REMOVING ALL OF THESE +SQRESULT SQ_GetVerifiedModsList(void* sqvm) +{ + std::string mods = GetVerifiedModsList(); + const SQChar* buffer = mods.c_str(); + ClientSq_pushstring(sqvm, buffer, -1); + return SQRESULT_NOTNULL; +}*/ + +ADD_SQFUNC("bool", IsModVerified, "string modName, string modVersion", "", ScriptContext::UI) +{ + const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); + const SQChar* modVersion = g_pSquirrel->getstring(sqvm, 2); + + bool result = IsModVerified((char*)modName, (char*)modVersion); + g_pSquirrel->pushbool(sqvm, result); + + return SQRESULT_NOTNULL; +} + +/* +SQRESULT SQ_IsModVerified(void* sqvm) +{ + const SQChar* modName = ClientSq_getstring(sqvm, 1); + const SQChar* modVersion = ClientSq_getstring(sqvm, 2); + + bool result = IsModVerified((char*)modName, (char*)modVersion); + + ClientSq_pushbool(sqvm, result); + return SQRESULT_NOTNULL; +} + +void InitialiseVerifiedModsScripts(HMODULE baseAddress) +{ + g_UISquirrelManager->AddFuncRegistration("string", "GetVerifiedModsList", "", "", SQ_GetVerifiedModsList); + g_UISquirrelManager->AddFuncRegistration("bool", "IsModVerified", "string modName, string modVersion", "", SQ_IsModVerified); +}*/ diff --git a/NorthstarDLL/verifiedmods.h b/NorthstarDLL/verifiedmods.h new file mode 100644 index 000000000..30957f1e9 --- /dev/null +++ b/NorthstarDLL/verifiedmods.h @@ -0,0 +1,4 @@ +#pragma once +#include "memalloc.h" + +void InitialiseVerifiedModsScripts(HMODULE baseAddress); From 1030b8b86efd4d470209500817a9433ad874174c Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 29 Nov 2022 01:35:14 +0100 Subject: [PATCH 02/78] refactor: remove old code --- NorthstarDLL/verifiedmods.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 05baa19f4..d5072fcf2 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -155,16 +155,6 @@ ADD_SQFUNC("string", GetVerifiedModsList, "", "", ScriptContext::UI) return SQRESULT_NOTNULL; } -/* -* TODO TEST BEFORE REMOVING ALL OF THESE -SQRESULT SQ_GetVerifiedModsList(void* sqvm) -{ - std::string mods = GetVerifiedModsList(); - const SQChar* buffer = mods.c_str(); - ClientSq_pushstring(sqvm, buffer, -1); - return SQRESULT_NOTNULL; -}*/ - ADD_SQFUNC("bool", IsModVerified, "string modName, string modVersion", "", ScriptContext::UI) { const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); @@ -175,21 +165,3 @@ ADD_SQFUNC("bool", IsModVerified, "string modName, string modVersion", "", Scrip return SQRESULT_NOTNULL; } - -/* -SQRESULT SQ_IsModVerified(void* sqvm) -{ - const SQChar* modName = ClientSq_getstring(sqvm, 1); - const SQChar* modVersion = ClientSq_getstring(sqvm, 2); - - bool result = IsModVerified((char*)modName, (char*)modVersion); - - ClientSq_pushbool(sqvm, result); - return SQRESULT_NOTNULL; -} - -void InitialiseVerifiedModsScripts(HMODULE baseAddress) -{ - g_UISquirrelManager->AddFuncRegistration("string", "GetVerifiedModsList", "", "", SQ_GetVerifiedModsList); - g_UISquirrelManager->AddFuncRegistration("bool", "IsModVerified", "string modName, string modVersion", "", SQ_IsModVerified); -}*/ From dfdee00141e35dfc30290c1b49305d39468d3341 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 29 Nov 2022 22:21:15 +0100 Subject: [PATCH 03/78] feat: download method fetches ZIP archive from Thunderstore API --- NorthstarDLL/verifiedmods.cpp | 64 +++++++++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index d5072fcf2..a399adddb 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -14,9 +14,10 @@ Document verifiedModsJson; const char* modsTestString = "{" "\"Dinorush's LTS Rebalance\" : {\"DependencyPrefix\" : \"Dinorush-LTSRebalance\", \"Versions\" : []}, " - "\"Dinorush.Brute4\" : {\"DependencyPrefix\" : \"Dinorush-Brute4\", \"Versions\" : [ \"1.5\", \"1.6\" ]}, " + "\"Dinorush.Brute4\" : {\"DependencyPrefix\" : \"Dinorush-DinorushBrute4\", \"Versions\" : [ \"1.5\", \"1.6.0\" ]}, " "\"Mod Settings\" : {\"DependencyPrefix\" : \"EladNLG-ModSettings\", \"Versions\" : [ \"1.0.0\", \"1.1.0\" ]}, " - "\"Moblin.Archon\" : {\"DependencyPrefix\" : \"GalacticMoblin-MoblinArchon\", \"Versions\" : [ \"1.3.0\", \"1.3.1\" ]}" + "\"Moblin.Archon\" : {\"DependencyPrefix\" : \"GalacticMoblin-MoblinArchon\", \"Versions\" : [ \"1.3.0\", \"1.3.1\" ]}," + "\"Fifty.mp_frostbite\" : {\"DependencyPrefix\" : \"Fifty-Frostbite\", \"Versions\" : [ \"0.0.1\" ]}" "}"; void _FetchVerifiedModsList() @@ -132,15 +133,66 @@ bool IsModVerified(char* modName, char* modVersion) return false; } +size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) +{ + size_t written; + written = fwrite(ptr, size, nmemb, stream); + return written; +} + void DownloadMod(char* modName, char* modVersion) { if (!IsModVerified(modName, modVersion)) return; - // TODO check if mod is already present - // TODO check if mod is verified (throw if not) - // TODO download zip in temporary folder - // TODO move mod to mods/ folder + // Rebuild mod dependency string. + const Value& entry = verifiedModsJson[modName]; + std::string dependencyString = entry["DependencyPrefix"].GetString(); + GenericArray versions = entry["Versions"].GetArray(); + dependencyString.append("-"); + dependencyString.append(modVersion); + + std::thread requestThread( + [dependencyString]() + { + // loading game path + std::filesystem::path downloadPath = std::filesystem::temp_directory_path() / ((std::string)dependencyString + ".zip"); + + CURL* curl = curl_easy_init(); + FILE* fp = fopen(downloadPath.generic_string().c_str(), "wb"); + CURLcode result; + + std::string url = "https://gcdn.thunderstore.io/live/repository/packages/" + (std::string)dependencyString + ".zip"; + spdlog::info("Downloading mod:"); + spdlog::info(" => from {}", url); + spdlog::info(" => to {}", downloadPath.generic_string()); + + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); + + spdlog::info("Fetching mod {} from Thunderstore...", dependencyString); + result = curl_easy_perform(curl); + curl_easy_cleanup(curl); + + if (result == CURLcode::CURLE_OK) + { + spdlog::info("Ok"); + } + else + { + spdlog::info("Fetching mod failed: {}", curl_easy_strerror(result)); + return; + } + + // TODO unzip folder + // TODO move mod to mods/ folder + // TODO remove temporary folder + + REQUEST_END_CLEANUP: + fclose(fp); + }); + requestThread.detach(); } /** From 10cd16fb2feafc01bda3549b2f49a74d9369a135 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 29 Nov 2022 22:27:09 +0100 Subject: [PATCH 04/78] feat: expose DownloadMod method to Squirrel VM --- NorthstarDLL/verifiedmods.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index a399adddb..d28472c06 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -217,3 +217,11 @@ ADD_SQFUNC("bool", IsModVerified, "string modName, string modVersion", "", Scrip return SQRESULT_NOTNULL; } + +ADD_SQFUNC("void", DownloadMod, "string modName, string modVersion", "", ScriptContext::UI) +{ + const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); + const SQChar* modVersion = g_pSquirrel->getstring(sqvm, 2); + DownloadMod((char*)modName, (char*)modVersion); + return SQRESULT_NULL; +} From 92595eb746fd7e430cae549afab4fc68d1340fde Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Wed, 30 Nov 2022 23:51:56 +0100 Subject: [PATCH 05/78] feat: use a list to tell which mods are being downloaded --- NorthstarDLL/verifiedmods.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index d28472c06..8fa5c4c3d 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -9,6 +9,7 @@ using namespace rapidjson; Document verifiedModsJson; +std::vector modsBeingDownloaded {}; // Test string used to test branch without masterserver const char* modsTestString = @@ -133,6 +134,11 @@ bool IsModVerified(char* modName, char* modVersion) return false; } +bool IsModBeingDownloaded(char* modName) +{ + return std::find(modsBeingDownloaded.begin(), modsBeingDownloaded.end(), modName) != modsBeingDownloaded.end(); +} + size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) { size_t written; @@ -145,6 +151,8 @@ void DownloadMod(char* modName, char* modVersion) if (!IsModVerified(modName, modVersion)) return; + modsBeingDownloaded.push_back( modName ); + // Rebuild mod dependency string. const Value& entry = verifiedModsJson[modName]; std::string dependencyString = entry["DependencyPrefix"].GetString(); @@ -153,7 +161,7 @@ void DownloadMod(char* modName, char* modVersion) dependencyString.append(modVersion); std::thread requestThread( - [dependencyString]() + [dependencyString, modName]() { // loading game path std::filesystem::path downloadPath = std::filesystem::temp_directory_path() / ((std::string)dependencyString + ".zip"); @@ -191,6 +199,7 @@ void DownloadMod(char* modName, char* modVersion) REQUEST_END_CLEANUP: fclose(fp); + modsBeingDownloaded.erase( std::remove(std::begin(modsBeingDownloaded), std::end(modsBeingDownloaded), modName) ); }); requestThread.detach(); } @@ -218,6 +227,16 @@ ADD_SQFUNC("bool", IsModVerified, "string modName, string modVersion", "", Scrip return SQRESULT_NOTNULL; } +ADD_SQFUNC("bool", IsModBeingDownloaded, "string modName", "", ScriptContext::UI) +{ + const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); + + bool result = IsModBeingDownloaded((char*)modName); + g_pSquirrel->pushbool(sqvm, result); + + return SQRESULT_NOTNULL; +} + ADD_SQFUNC("void", DownloadMod, "string modName, string modVersion", "", ScriptContext::UI) { const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); From 018755dba02732a84b0b3a9a08c2c1be38f572f6 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Thu, 1 Dec 2022 00:16:56 +0100 Subject: [PATCH 06/78] docs: add documentation to all methods --- NorthstarDLL/verifiedmods.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 8fa5c4c3d..9571666e3 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -8,7 +8,10 @@ using namespace rapidjson; +// This JSON contains all verified mods. Document verifiedModsJson; + +// This list holds the names of all mods that are currently being downloaded. std::vector modsBeingDownloaded {}; // Test string used to test branch without masterserver @@ -21,6 +24,11 @@ const char* modsTestString = "\"Fifty.mp_frostbite\" : {\"DependencyPrefix\" : \"Fifty-Frostbite\", \"Versions\" : [ \"0.0.1\" ]}" "}"; + +/** + * Fetches the list of verified mods from the master server, and store it in the verifiedModsJson variable. + * Since master server does not expose verified mods resource *yet*, this uses mods stored in the modsTestString variable. + **/ void _FetchVerifiedModsList() { spdlog::info("Requesting verified mods list from {}", Cvar_ns_masterserver_hostname->GetString()); @@ -80,6 +88,11 @@ void _FetchVerifiedModsList() requestThread.detach(); } + +/** + * Loads up verified mods list in memory, and returns it when it was received from master server. + * This method is called by the Squirrel VM at launch. + **/ std::string GetVerifiedModsList() { if (verifiedModsJson.IsNull()) @@ -104,7 +117,7 @@ std::string GetVerifiedModsList() /** * Checks if a mod is verified by controlling if its name matches a key in the verified mods JSON * document, and if its version is included in the JSON versions list. - */ + **/ bool IsModVerified(char* modName, char* modVersion) { // 1. Mod is not verified if its name isn't a `verifiedModsJson` key. @@ -134,11 +147,19 @@ bool IsModVerified(char* modName, char* modVersion) return false; } + +/** + * Tells if a mod is currently being downloaded by checking if its name is included in the `modsBeingDownloaded` variable. + **/ bool IsModBeingDownloaded(char* modName) { return std::find(modsBeingDownloaded.begin(), modsBeingDownloaded.end(), modName) != modsBeingDownloaded.end(); } + +/** + * cURL method to write data to disk. + **/ size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) { size_t written; @@ -146,6 +167,14 @@ size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) return written; } +/** + * Downloads a given mod from Thunderstore API to local game folder. + * This is done following these steps: + * * Recreating mod dependency string from verified mods information; + * * Fetching mod .zip archive from Thunderstore API to local temporary storage; + * * Extracting archive content into game folder; + * * Cleaning. + **/ void DownloadMod(char* modName, char* modVersion) { if (!IsModVerified(modName, modVersion)) From 97058fbc4cd8caaabaef6c5fa6120a10e8a9143a Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Thu, 1 Dec 2022 00:27:10 +0100 Subject: [PATCH 07/78] docs: add big-ass section titles in ASCII-art because why not --- NorthstarDLL/verifiedmods.cpp | 44 ++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 9571666e3..4664909d5 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -8,6 +8,18 @@ using namespace rapidjson; + + +/* + ██████╗ ██╗ ██████╗ ██████╗ █████╗ ██╗ ██╗ ██╗ █████╗ ██████╗ ██╗ █████╗ ██████╗ ██╗ ███████╗███████╗ +██╔════╝ ██║ ██╔═══██╗██╔══██╗██╔══██╗██║ ██║ ██║██╔══██╗██╔══██╗██║██╔══██╗██╔══██╗██║ ██╔════╝██╔════╝ +██║ ███╗██║ ██║ ██║██████╔╝███████║██║ ██║ ██║███████║██████╔╝██║███████║██████╔╝██║ █████╗ ███████╗ +██║ ██║██║ ██║ ██║██╔══██╗██╔══██║██║ ╚██╗ ██╔╝██╔══██║██╔══██╗██║██╔══██║██╔══██╗██║ ██╔══╝ ╚════██║ +╚██████╔╝███████╗╚██████╔╝██████╔╝██║ ██║███████╗ ╚████╔╝ ██║ ██║██║ ██║██║██║ ██║██████╔╝███████╗███████╗███████║ + ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚══════╝╚══════╝ +*/ + + // This JSON contains all verified mods. Document verifiedModsJson; @@ -25,6 +37,17 @@ const char* modsTestString = "}"; + +/* +███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ███████╗ +████╗ ████║██╔════╝╚══██╔══╝██║ ██║██╔═══██╗██╔══██╗██╔════╝ +██╔████╔██║█████╗ ██║ ███████║██║ ██║██║ ██║███████╗ +██║╚██╔╝██║██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║╚════██║ +██║ ╚═╝ ██║███████╗ ██║ ██║ ██║╚██████╔╝██████╔╝███████║ +╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ +*/ + + /** * Fetches the list of verified mods from the master server, and store it in the verifiedModsJson variable. * Since master server does not expose verified mods resource *yet*, this uses mods stored in the modsTestString variable. @@ -233,9 +256,24 @@ void DownloadMod(char* modName, char* modVersion) requestThread.detach(); } -/** - * Squirrel-exposed wrapper methods - **/ + + +/* +███████╗ ██████╗ ██╗ ██╗██╗██████╗ ██████╗ ███████╗██╗ ███████╗██╗ ██╗██████╗ ██████╗ ███████╗███████╗██████╗ +██╔════╝██╔═══██╗██║ ██║██║██╔══██╗██╔══██╗██╔════╝██║ ██╔════╝╚██╗██╔╝██╔══██╗██╔═══██╗██╔════╝██╔════╝██╔══██╗ +███████╗██║ ██║██║ ██║██║██████╔╝██████╔╝█████╗ ██║█████╗█████╗ ╚███╔╝ ██████╔╝██║ ██║███████╗█████╗ ██║ ██║ +╚════██║██║▄▄ ██║██║ ██║██║██╔══██╗██╔══██╗██╔══╝ ██║╚════╝██╔══╝ ██╔██╗ ██╔═══╝ ██║ ██║╚════██║██╔══╝ ██║ ██║ +███████║╚██████╔╝╚██████╔╝██║██║ ██║██║ ██║███████╗███████╗ ███████╗██╔╝ ██╗██║ ╚██████╔╝███████║███████╗██████╔╝ +╚══════╝ ╚══▀▀═╝ ╚═════╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚══════╝╚══════╝╚═════╝ + +██╗ ██╗██████╗ █████╗ ██████╗ ██████╗ ███████╗██████╗ ███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ███████╗ +██║ ██║██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗ ████╗ ████║██╔════╝╚══██╔══╝██║ ██║██╔═══██╗██╔══██╗██╔════╝ +██║ █╗ ██║██████╔╝███████║██████╔╝██████╔╝█████╗ ██████╔╝ ██╔████╔██║█████╗ ██║ ███████║██║ ██║██║ ██║███████╗ +██║███╗██║██╔══██╗██╔══██║██╔═══╝ ██╔═══╝ ██╔══╝ ██╔══██╗ ██║╚██╔╝██║██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║╚════██║ +╚███╔███╔╝██║ ██║██║ ██║██║ ██║ ███████╗██║ ██║ ██║ ╚═╝ ██║███████╗ ██║ ██║ ██║╚██████╔╝██████╔╝███████║ + ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ +*/ + ADD_SQFUNC("string", GetVerifiedModsList, "", "", ScriptContext::UI) { From 86c3ba2251ae1c5e90f104fe39f22bc4a04fca5f Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Fri, 2 Dec 2022 15:53:25 +0100 Subject: [PATCH 08/78] build: add libzip library --- NorthstarDLL/include/libzip/include/bzlib.h | 276 +++ NorthstarDLL/include/libzip/include/zconf.h | 557 +++++ NorthstarDLL/include/libzip/include/zip.h | 487 +++++ NorthstarDLL/include/libzip/include/zipconf.h | 51 + NorthstarDLL/include/libzip/include/zlib.h | 1935 +++++++++++++++++ NorthstarDLL/include/libzip/lib/bz2.lib | Bin 0 -> 6224 bytes .../include/libzip/lib/pkgconfig/bzip2.pc | 12 + .../include/libzip/lib/pkgconfig/libzip.pc | 15 + .../include/libzip/lib/pkgconfig/zlib.pc | 14 + NorthstarDLL/include/libzip/lib/zip.lib | Bin 0 -> 27916 bytes NorthstarDLL/include/libzip/lib/zlib.lib | Bin 0 -> 16746 bytes .../include/libzip/share/bzip2/copyright | 42 + NorthstarDLL/include/libzip/share/bzip2/usage | 4 + .../libzip/share/bzip2/vcpkg.spdx.json | 204 ++ .../libzip/share/bzip2/vcpkg_abi_info.txt | 21 + .../include/libzip/share/libzip/copyright | 31 + .../share/libzip/libzip-config-version.cmake | 48 + .../libzip/share/libzip/libzip-config.cmake | 47 + .../share/libzip/libzip-targets-debug.cmake | 19 + .../share/libzip/libzip-targets-release.cmake | 19 + .../libzip/share/libzip/libzip-targets.cmake | 101 + .../libzip/share/libzip/vcpkg.spdx.json | 137 ++ .../libzip/share/libzip/vcpkg_abi_info.txt | 19 + .../libzip/share/vcpkg-cmake-config/copyright | 23 + .../vcpkg-port-config.cmake | 1 + .../share/vcpkg-cmake-config/vcpkg.spdx.json | 165 ++ .../vcpkg-cmake-config/vcpkg_abi_info.txt | 13 + .../vcpkg_cmake_config_fixup.cmake | 258 +++ .../libzip/share/vcpkg-cmake/copyright | 23 + .../share/vcpkg-cmake/vcpkg-port-config.cmake | 3 + .../libzip/share/vcpkg-cmake/vcpkg.spdx.json | 187 ++ .../share/vcpkg-cmake/vcpkg_abi_info.txt | 19 + .../share/vcpkg-cmake/vcpkg_cmake_build.cmake | 91 + .../vcpkg-cmake/vcpkg_cmake_configure.cmake | 320 +++ .../vcpkg-cmake/vcpkg_cmake_install.cmake | 21 + .../include/libzip/share/zlib/copyright | 22 + NorthstarDLL/include/libzip/share/zlib/usage | 4 + .../share/zlib/vcpkg-cmake-wrapper.cmake | 12 + .../include/libzip/share/zlib/vcpkg.spdx.json | 247 +++ .../libzip/share/zlib/vcpkg_abi_info.txt | 21 + .../include/libzip/tools/bzip2/bzip2.exe | Bin 0 -> 92672 bytes .../libzip/tools/bzip2/bzip2recover.exe | Bin 0 -> 19456 bytes NorthstarDLL/verifiedmods.cpp | 11 + 43 files changed, 5480 insertions(+) create mode 100644 NorthstarDLL/include/libzip/include/bzlib.h create mode 100644 NorthstarDLL/include/libzip/include/zconf.h create mode 100644 NorthstarDLL/include/libzip/include/zip.h create mode 100644 NorthstarDLL/include/libzip/include/zipconf.h create mode 100644 NorthstarDLL/include/libzip/include/zlib.h create mode 100644 NorthstarDLL/include/libzip/lib/bz2.lib create mode 100644 NorthstarDLL/include/libzip/lib/pkgconfig/bzip2.pc create mode 100644 NorthstarDLL/include/libzip/lib/pkgconfig/libzip.pc create mode 100644 NorthstarDLL/include/libzip/lib/pkgconfig/zlib.pc create mode 100644 NorthstarDLL/include/libzip/lib/zip.lib create mode 100644 NorthstarDLL/include/libzip/lib/zlib.lib create mode 100644 NorthstarDLL/include/libzip/share/bzip2/copyright create mode 100644 NorthstarDLL/include/libzip/share/bzip2/usage create mode 100644 NorthstarDLL/include/libzip/share/bzip2/vcpkg.spdx.json create mode 100644 NorthstarDLL/include/libzip/share/bzip2/vcpkg_abi_info.txt create mode 100644 NorthstarDLL/include/libzip/share/libzip/copyright create mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-config-version.cmake create mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-config.cmake create mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-targets-debug.cmake create mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-targets-release.cmake create mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-targets.cmake create mode 100644 NorthstarDLL/include/libzip/share/libzip/vcpkg.spdx.json create mode 100644 NorthstarDLL/include/libzip/share/libzip/vcpkg_abi_info.txt create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/copyright create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg-port-config.cmake create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg.spdx.json create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_abi_info.txt create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/copyright create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg-port-config.cmake create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg.spdx.json create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_abi_info.txt create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_build.cmake create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_configure.cmake create mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_install.cmake create mode 100644 NorthstarDLL/include/libzip/share/zlib/copyright create mode 100644 NorthstarDLL/include/libzip/share/zlib/usage create mode 100644 NorthstarDLL/include/libzip/share/zlib/vcpkg-cmake-wrapper.cmake create mode 100644 NorthstarDLL/include/libzip/share/zlib/vcpkg.spdx.json create mode 100644 NorthstarDLL/include/libzip/share/zlib/vcpkg_abi_info.txt create mode 100644 NorthstarDLL/include/libzip/tools/bzip2/bzip2.exe create mode 100644 NorthstarDLL/include/libzip/tools/bzip2/bzip2recover.exe diff --git a/NorthstarDLL/include/libzip/include/bzlib.h b/NorthstarDLL/include/libzip/include/bzlib.h new file mode 100644 index 000000000..015f8d1cb --- /dev/null +++ b/NorthstarDLL/include/libzip/include/bzlib.h @@ -0,0 +1,276 @@ + +/*-------------------------------------------------------------*/ +/*--- Public header file for the library. ---*/ +/*--- bzlib.h ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.8 of 13 July 2019 + Copyright (C) 1996-2019 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#ifndef _BZLIB_H +#define _BZLIB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BZ_RUN 0 +#define BZ_FLUSH 1 +#define BZ_FINISH 2 + +#define BZ_OK 0 +#define BZ_RUN_OK 1 +#define BZ_FLUSH_OK 2 +#define BZ_FINISH_OK 3 +#define BZ_STREAM_END 4 +#define BZ_SEQUENCE_ERROR (-1) +#define BZ_PARAM_ERROR (-2) +#define BZ_MEM_ERROR (-3) +#define BZ_DATA_ERROR (-4) +#define BZ_DATA_ERROR_MAGIC (-5) +#define BZ_IO_ERROR (-6) +#define BZ_UNEXPECTED_EOF (-7) +#define BZ_OUTBUFF_FULL (-8) +#define BZ_CONFIG_ERROR (-9) + +typedef + struct { + char *next_in; + unsigned int avail_in; + unsigned int total_in_lo32; + unsigned int total_in_hi32; + + char *next_out; + unsigned int avail_out; + unsigned int total_out_lo32; + unsigned int total_out_hi32; + + void *state; + + void *(*bzalloc)(void *,int,int); + void (*bzfree)(void *,void *); + void *opaque; + } + bz_stream; + +#ifndef BZ_NO_STDIO +/* Need a definitition for FILE */ +#include +#endif + +#ifdef _WIN32 +# ifdef small + /* windows.h define small to char */ +# undef small +# endif +# define BZ_API(func) func +# if defined(BZ_BUILD_DLL) +# define BZ_EXTERN __declspec(dllexport) +# elif 1 +# define BZ_EXTERN __declspec(dllimport) +# else +# define BZ_EXTERN +# endif +#else +# define BZ_API(func) func +# define BZ_EXTERN extern +#endif + + +/*-- Core (low-level) library functions --*/ + +BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( + bz_stream* strm, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN int BZ_API(BZ2_bzCompress) ( + bz_stream* strm, + int action + ); + +BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( + bz_stream* strm + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( + bz_stream *strm, + int verbosity, + int small + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( + bz_stream* strm + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( + bz_stream *strm + ); + + + +/*-- High(er) level library functions --*/ + +#ifndef BZ_NO_STDIO +#define BZ_MAX_UNUSED 5000 + +typedef void BZFILE; + +BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( + int* bzerror, + FILE* f, + int verbosity, + int small, + void* unused, + int nUnused + ); + +BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( + int* bzerror, + BZFILE* b + ); + +BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( + int* bzerror, + BZFILE* b, + void** unused, + int* nUnused + ); + +BZ_EXTERN int BZ_API(BZ2_bzRead) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( + int* bzerror, + FILE* f, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN void BZ_API(BZ2_bzWrite) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in, + unsigned int* nbytes_out + ); + +BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in_lo32, + unsigned int* nbytes_in_hi32, + unsigned int* nbytes_out_lo32, + unsigned int* nbytes_out_hi32 + ); +#endif + + +/*-- Utility functions --*/ + +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int small, + int verbosity + ); + + +/*-- + Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) + to support better zlib compatibility. + This code is not _officially_ part of libbzip2 (yet); + I haven't tested it, documented it, or considered the + threading-safeness of it. + If this code breaks, please contact both Yoshioka and me. +--*/ + +BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( + void + ); + +#ifndef BZ_NO_STDIO +BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( + const char *path, + const char *mode + ); + +BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( + int fd, + const char *mode + ); + +BZ_EXTERN int BZ_API(BZ2_bzread) ( + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN int BZ_API(BZ2_bzwrite) ( + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN int BZ_API(BZ2_bzflush) ( + BZFILE* b + ); + +BZ_EXTERN void BZ_API(BZ2_bzclose) ( + BZFILE* b + ); + +BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( + BZFILE *b, + int *errnum + ); +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +/*-------------------------------------------------------------*/ +/*--- end bzlib.h ---*/ +/*-------------------------------------------------------------*/ diff --git a/NorthstarDLL/include/libzip/include/zconf.h b/NorthstarDLL/include/libzip/include/zconf.h new file mode 100644 index 000000000..b3309e8f7 --- /dev/null +++ b/NorthstarDLL/include/libzip/include/zconf.h @@ -0,0 +1,557 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H +/* #undef Z_PREFIX */ +/* #undef Z_HAVE_UNISTD_H */ + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + * Even better than compiling with -DZ_PREFIX would be to use configure to set + * this permanently in zconf.h using "./configure --zprefix". + */ +#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ +# define Z_PREFIX_SET + +/* all linked symbols and init macros */ +# define _dist_code z__dist_code +# define _length_code z__length_code +# define _tr_align z__tr_align +# define _tr_flush_bits z__tr_flush_bits +# define _tr_flush_block z__tr_flush_block +# define _tr_init z__tr_init +# define _tr_stored_block z__tr_stored_block +# define _tr_tally z__tr_tally +# define adler32 z_adler32 +# define adler32_combine z_adler32_combine +# define adler32_combine64 z_adler32_combine64 +# define adler32_z z_adler32_z +# ifndef Z_SOLO +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# endif +# define crc32 z_crc32 +# define crc32_combine z_crc32_combine +# define crc32_combine64 z_crc32_combine64 +# define crc32_combine_gen z_crc32_combine_gen +# define crc32_combine_gen64 z_crc32_combine_gen64 +# define crc32_combine_op z_crc32_combine_op +# define crc32_z z_crc32_z +# define deflate z_deflate +# define deflateBound z_deflateBound +# define deflateCopy z_deflateCopy +# define deflateEnd z_deflateEnd +# define deflateGetDictionary z_deflateGetDictionary +# define deflateInit z_deflateInit +# define deflateInit2 z_deflateInit2 +# define deflateInit2_ z_deflateInit2_ +# define deflateInit_ z_deflateInit_ +# define deflateParams z_deflateParams +# define deflatePending z_deflatePending +# define deflatePrime z_deflatePrime +# define deflateReset z_deflateReset +# define deflateResetKeep z_deflateResetKeep +# define deflateSetDictionary z_deflateSetDictionary +# define deflateSetHeader z_deflateSetHeader +# define deflateTune z_deflateTune +# define deflate_copyright z_deflate_copyright +# define get_crc_table z_get_crc_table +# ifndef Z_SOLO +# define gz_error z_gz_error +# define gz_intmax z_gz_intmax +# define gz_strwinerror z_gz_strwinerror +# define gzbuffer z_gzbuffer +# define gzclearerr z_gzclearerr +# define gzclose z_gzclose +# define gzclose_r z_gzclose_r +# define gzclose_w z_gzclose_w +# define gzdirect z_gzdirect +# define gzdopen z_gzdopen +# define gzeof z_gzeof +# define gzerror z_gzerror +# define gzflush z_gzflush +# define gzfread z_gzfread +# define gzfwrite z_gzfwrite +# define gzgetc z_gzgetc +# define gzgetc_ z_gzgetc_ +# define gzgets z_gzgets +# define gzoffset z_gzoffset +# define gzoffset64 z_gzoffset64 +# define gzopen z_gzopen +# define gzopen64 z_gzopen64 +# ifdef _WIN32 +# define gzopen_w z_gzopen_w +# endif +# define gzprintf z_gzprintf +# define gzputc z_gzputc +# define gzputs z_gzputs +# define gzread z_gzread +# define gzrewind z_gzrewind +# define gzseek z_gzseek +# define gzseek64 z_gzseek64 +# define gzsetparams z_gzsetparams +# define gztell z_gztell +# define gztell64 z_gztell64 +# define gzungetc z_gzungetc +# define gzvprintf z_gzvprintf +# define gzwrite z_gzwrite +# endif +# define inflate z_inflate +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define inflateBackInit z_inflateBackInit +# define inflateBackInit_ z_inflateBackInit_ +# define inflateCodesUsed z_inflateCodesUsed +# define inflateCopy z_inflateCopy +# define inflateEnd z_inflateEnd +# define inflateGetDictionary z_inflateGetDictionary +# define inflateGetHeader z_inflateGetHeader +# define inflateInit z_inflateInit +# define inflateInit2 z_inflateInit2 +# define inflateInit2_ z_inflateInit2_ +# define inflateInit_ z_inflateInit_ +# define inflateMark z_inflateMark +# define inflatePrime z_inflatePrime +# define inflateReset z_inflateReset +# define inflateReset2 z_inflateReset2 +# define inflateResetKeep z_inflateResetKeep +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateUndermine z_inflateUndermine +# define inflateValidate z_inflateValidate +# define inflate_copyright z_inflate_copyright +# define inflate_fast z_inflate_fast +# define inflate_table z_inflate_table +# ifndef Z_SOLO +# define uncompress z_uncompress +# define uncompress2 z_uncompress2 +# endif +# define zError z_zError +# ifndef Z_SOLO +# define zcalloc z_zcalloc +# define zcfree z_zcfree +# endif +# define zlibCompileFlags z_zlibCompileFlags +# define zlibVersion z_zlibVersion + +/* all zlib typedefs in zlib.h and zconf.h */ +# define Byte z_Byte +# define Bytef z_Bytef +# define alloc_func z_alloc_func +# define charf z_charf +# define free_func z_free_func +# ifndef Z_SOLO +# define gzFile z_gzFile +# endif +# define gz_header z_gz_header +# define gz_headerp z_gz_headerp +# define in_func z_in_func +# define intf z_intf +# define out_func z_out_func +# define uInt z_uInt +# define uIntf z_uIntf +# define uLong z_uLong +# define uLongf z_uLongf +# define voidp z_voidp +# define voidpc z_voidpc +# define voidpf z_voidpf + +/* all zlib structs in zlib.h and zconf.h */ +# define gz_header_s z_gz_header_s +# define internal_state z_internal_state + +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + +#ifdef Z_SOLO + typedef unsigned long z_size_t; +#else +# define z_longlong long long +# if defined(NO_SIZE_T) + typedef unsigned NO_SIZE_T z_size_t; +# elif defined(STDC) +# include + typedef size_t z_size_t; +# else + typedef unsigned long z_size_t; +# endif +# undef z_longlong +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus about 7 kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +#ifndef Z_ARG /* function prototypes for stdarg */ +# if defined(STDC) || defined(Z_HAVE_STDARG_H) +# define Z_ARG(args) args +# else +# define Z_ARG(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# if 1 +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# if 1 +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) +# include +# if (UINT_MAX == 0xffffffffUL) +# define Z_U4 unsigned +# elif (ULONG_MAX == 0xffffffffUL) +# define Z_U4 unsigned long +# elif (USHRT_MAX == 0xffffffffUL) +# define Z_U4 unsigned short +# endif +#endif + +#ifdef Z_U4 + typedef Z_U4 z_crc_t; +#else + typedef unsigned long z_crc_t; +#endif + +#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 +# define Z_HAVE_UNISTD_H +# elif HAVE_UNISTD_H != 0 +# define Z_HAVE_UNISTD_H +# endif +#endif + +#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 +# define Z_HAVE_STDARG_H +# elif HAVE_STDARG_H != 0 +# define Z_HAVE_STDARG_H +# endif +#endif + +#ifdef STDC +# ifndef Z_SOLO +# include /* for off_t */ +# endif +#endif + +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifndef Z_SOLO +# include /* for va_list */ +# endif +#endif + +#ifdef _WIN32 +# ifndef Z_SOLO +# include /* for wchar_t */ +# endif +#endif + +/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and + * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even + * though the former does not conform to the LFS document), but considering + * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as + * equivalently requesting no 64-bit operations + */ +#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 +# undef _LARGEFILE64_SOURCE +#endif + +#ifndef Z_HAVE_UNISTD_H +# ifdef __WATCOMC__ +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_HAVE_UNISTD_H +# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32) +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_SOLO +# if defined(Z_HAVE_UNISTD_H) +# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ +# ifdef VMS +# include /* for off_t */ +# endif +# ifndef z_off_t +# define z_off_t off_t +# endif +# endif +#endif + +#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 +# define Z_LFS64 +#endif + +#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) +# define Z_LARGE64 +#endif + +#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) +# define Z_WANT64 +#endif + +#if !defined(SEEK_SET) && !defined(Z_SOLO) +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif + +#ifndef z_off_t +# define z_off_t long +#endif + +#if !defined(_WIN32) && defined(Z_LARGE64) +# define z_off64_t off64_t +#else +# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# define z_off64_t __int64 +# else +# define z_off64_t z_off_t +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) + #pragma map(deflateInit_,"DEIN") + #pragma map(deflateInit2_,"DEIN2") + #pragma map(deflateEnd,"DEEND") + #pragma map(deflateBound,"DEBND") + #pragma map(inflateInit_,"ININ") + #pragma map(inflateInit2_,"ININ2") + #pragma map(inflateEnd,"INEND") + #pragma map(inflateSync,"INSY") + #pragma map(inflateSetDictionary,"INSEDI") + #pragma map(compressBound,"CMBND") + #pragma map(inflate_table,"INTABL") + #pragma map(inflate_fast,"INFA") + #pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/NorthstarDLL/include/libzip/include/zip.h b/NorthstarDLL/include/libzip/include/zip.h new file mode 100644 index 000000000..283607a5a --- /dev/null +++ b/NorthstarDLL/include/libzip/include/zip.h @@ -0,0 +1,487 @@ +#ifndef _HAD_ZIP_H +#define _HAD_ZIP_H + +/* + zip.h -- exported declarations. + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* fix autoindent */ +#endif +#endif + +#include + +#ifndef ZIP_EXTERN +#ifndef ZIP_STATIC +#ifdef _WIN32 +#define ZIP_EXTERN __declspec(dllimport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +#define ZIP_EXTERN __attribute__((visibility("default"))) +#else +#define ZIP_EXTERN +#endif +#else +#define ZIP_EXTERN +#endif +#endif + +#include +#include +#include + +/* flags for zip_open */ + +#define ZIP_CREATE 1 +#define ZIP_EXCL 2 +#define ZIP_CHECKCONS 4 +#define ZIP_TRUNCATE 8 +#define ZIP_RDONLY 16 + + +/* flags for zip_name_locate, zip_fopen, zip_stat, ... */ + +#define ZIP_FL_NOCASE 1u /* ignore case on name lookup */ +#define ZIP_FL_NODIR 2u /* ignore directory component */ +#define ZIP_FL_COMPRESSED 4u /* read compressed data */ +#define ZIP_FL_UNCHANGED 8u /* use original data, ignoring changes */ +#define ZIP_FL_RECOMPRESS 16u /* force recompression of data */ +#define ZIP_FL_ENCRYPTED 32u /* read encrypted data (implies ZIP_FL_COMPRESSED) */ +#define ZIP_FL_ENC_GUESS 0u /* guess string encoding (is default) */ +#define ZIP_FL_ENC_RAW 64u /* get unmodified string */ +#define ZIP_FL_ENC_STRICT 128u /* follow specification strictly */ +#define ZIP_FL_LOCAL 256u /* in local header */ +#define ZIP_FL_CENTRAL 512u /* in central directory */ +/* 1024u reserved for internal use */ +#define ZIP_FL_ENC_UTF_8 2048u /* string is UTF-8 encoded */ +#define ZIP_FL_ENC_CP437 4096u /* string is CP437 encoded */ +#define ZIP_FL_OVERWRITE 8192u /* zip_file_add: if file with name exists, overwrite (replace) it */ + +/* archive global flags flags */ + +#define ZIP_AFL_RDONLY 2u /* read only -- cannot be cleared */ + + +/* create a new extra field */ + +#define ZIP_EXTRA_FIELD_ALL ZIP_UINT16_MAX +#define ZIP_EXTRA_FIELD_NEW ZIP_UINT16_MAX + + +/* libzip error codes */ + +#define ZIP_ER_OK 0 /* N No error */ +#define ZIP_ER_MULTIDISK 1 /* N Multi-disk zip archives not supported */ +#define ZIP_ER_RENAME 2 /* S Renaming temporary file failed */ +#define ZIP_ER_CLOSE 3 /* S Closing zip archive failed */ +#define ZIP_ER_SEEK 4 /* S Seek error */ +#define ZIP_ER_READ 5 /* S Read error */ +#define ZIP_ER_WRITE 6 /* S Write error */ +#define ZIP_ER_CRC 7 /* N CRC error */ +#define ZIP_ER_ZIPCLOSED 8 /* N Containing zip archive was closed */ +#define ZIP_ER_NOENT 9 /* N No such file */ +#define ZIP_ER_EXISTS 10 /* N File already exists */ +#define ZIP_ER_OPEN 11 /* S Can't open file */ +#define ZIP_ER_TMPOPEN 12 /* S Failure to create temporary file */ +#define ZIP_ER_ZLIB 13 /* Z Zlib error */ +#define ZIP_ER_MEMORY 14 /* N Malloc failure */ +#define ZIP_ER_CHANGED 15 /* N Entry has been changed */ +#define ZIP_ER_COMPNOTSUPP 16 /* N Compression method not supported */ +#define ZIP_ER_EOF 17 /* N Premature end of file */ +#define ZIP_ER_INVAL 18 /* N Invalid argument */ +#define ZIP_ER_NOZIP 19 /* N Not a zip archive */ +#define ZIP_ER_INTERNAL 20 /* N Internal error */ +#define ZIP_ER_INCONS 21 /* L Zip archive inconsistent */ +#define ZIP_ER_REMOVE 22 /* S Can't remove file */ +#define ZIP_ER_DELETED 23 /* N Entry has been deleted */ +#define ZIP_ER_ENCRNOTSUPP 24 /* N Encryption method not supported */ +#define ZIP_ER_RDONLY 25 /* N Read-only archive */ +#define ZIP_ER_NOPASSWD 26 /* N No password provided */ +#define ZIP_ER_WRONGPASSWD 27 /* N Wrong password provided */ +#define ZIP_ER_OPNOTSUPP 28 /* N Operation not supported */ +#define ZIP_ER_INUSE 29 /* N Resource still in use */ +#define ZIP_ER_TELL 30 /* S Tell error */ +#define ZIP_ER_COMPRESSED_DATA 31 /* N Compressed data invalid */ +#define ZIP_ER_CANCELLED 32 /* N Operation cancelled */ + +/* type of system error value */ + +#define ZIP_ET_NONE 0 /* sys_err unused */ +#define ZIP_ET_SYS 1 /* sys_err is errno */ +#define ZIP_ET_ZLIB 2 /* sys_err is zlib error code */ +#define ZIP_ET_LIBZIP 3 /* sys_err is libzip error code */ + +/* compression methods */ + +#define ZIP_CM_DEFAULT -1 /* better of deflate or store */ +#define ZIP_CM_STORE 0 /* stored (uncompressed) */ +#define ZIP_CM_SHRINK 1 /* shrunk */ +#define ZIP_CM_REDUCE_1 2 /* reduced with factor 1 */ +#define ZIP_CM_REDUCE_2 3 /* reduced with factor 2 */ +#define ZIP_CM_REDUCE_3 4 /* reduced with factor 3 */ +#define ZIP_CM_REDUCE_4 5 /* reduced with factor 4 */ +#define ZIP_CM_IMPLODE 6 /* imploded */ +/* 7 - Reserved for Tokenizing compression algorithm */ +#define ZIP_CM_DEFLATE 8 /* deflated */ +#define ZIP_CM_DEFLATE64 9 /* deflate64 */ +#define ZIP_CM_PKWARE_IMPLODE 10 /* PKWARE imploding */ +/* 11 - Reserved by PKWARE */ +#define ZIP_CM_BZIP2 12 /* compressed using BZIP2 algorithm */ +/* 13 - Reserved by PKWARE */ +#define ZIP_CM_LZMA 14 /* LZMA (EFS) */ +/* 15-17 - Reserved by PKWARE */ +#define ZIP_CM_TERSE 18 /* compressed using IBM TERSE (new) */ +#define ZIP_CM_LZ77 19 /* IBM LZ77 z Architecture (PFS) */ +/* 20 - old value for Zstandard */ +#define ZIP_CM_LZMA2 33 +#define ZIP_CM_ZSTD 93 /* Zstandard compressed data */ +#define ZIP_CM_XZ 95 /* XZ compressed data */ +#define ZIP_CM_JPEG 96 /* Compressed Jpeg data */ +#define ZIP_CM_WAVPACK 97 /* WavPack compressed data */ +#define ZIP_CM_PPMD 98 /* PPMd version I, Rev 1 */ + +/* encryption methods */ + +#define ZIP_EM_NONE 0 /* not encrypted */ +#define ZIP_EM_TRAD_PKWARE 1 /* traditional PKWARE encryption */ +#if 0 /* Strong Encryption Header not parsed yet */ +#define ZIP_EM_DES 0x6601 /* strong encryption: DES */ +#define ZIP_EM_RC2_OLD 0x6602 /* strong encryption: RC2, version < 5.2 */ +#define ZIP_EM_3DES_168 0x6603 +#define ZIP_EM_3DES_112 0x6609 +#define ZIP_EM_PKZIP_AES_128 0x660e +#define ZIP_EM_PKZIP_AES_192 0x660f +#define ZIP_EM_PKZIP_AES_256 0x6610 +#define ZIP_EM_RC2 0x6702 /* strong encryption: RC2, version >= 5.2 */ +#define ZIP_EM_RC4 0x6801 +#endif +#define ZIP_EM_AES_128 0x0101 /* Winzip AES encryption */ +#define ZIP_EM_AES_192 0x0102 +#define ZIP_EM_AES_256 0x0103 +#define ZIP_EM_UNKNOWN 0xffff /* unknown algorithm */ + +#define ZIP_OPSYS_DOS 0x00u +#define ZIP_OPSYS_AMIGA 0x01u +#define ZIP_OPSYS_OPENVMS 0x02u +#define ZIP_OPSYS_UNIX 0x03u +#define ZIP_OPSYS_VM_CMS 0x04u +#define ZIP_OPSYS_ATARI_ST 0x05u +#define ZIP_OPSYS_OS_2 0x06u +#define ZIP_OPSYS_MACINTOSH 0x07u +#define ZIP_OPSYS_Z_SYSTEM 0x08u +#define ZIP_OPSYS_CPM 0x09u +#define ZIP_OPSYS_WINDOWS_NTFS 0x0au +#define ZIP_OPSYS_MVS 0x0bu +#define ZIP_OPSYS_VSE 0x0cu +#define ZIP_OPSYS_ACORN_RISC 0x0du +#define ZIP_OPSYS_VFAT 0x0eu +#define ZIP_OPSYS_ALTERNATE_MVS 0x0fu +#define ZIP_OPSYS_BEOS 0x10u +#define ZIP_OPSYS_TANDEM 0x11u +#define ZIP_OPSYS_OS_400 0x12u +#define ZIP_OPSYS_OS_X 0x13u + +#define ZIP_OPSYS_DEFAULT ZIP_OPSYS_UNIX + + +enum zip_source_cmd { + ZIP_SOURCE_OPEN, /* prepare for reading */ + ZIP_SOURCE_READ, /* read data */ + ZIP_SOURCE_CLOSE, /* reading is done */ + ZIP_SOURCE_STAT, /* get meta information */ + ZIP_SOURCE_ERROR, /* get error information */ + ZIP_SOURCE_FREE, /* cleanup and free resources */ + ZIP_SOURCE_SEEK, /* set position for reading */ + ZIP_SOURCE_TELL, /* get read position */ + ZIP_SOURCE_BEGIN_WRITE, /* prepare for writing */ + ZIP_SOURCE_COMMIT_WRITE, /* writing is done */ + ZIP_SOURCE_ROLLBACK_WRITE, /* discard written changes */ + ZIP_SOURCE_WRITE, /* write data */ + ZIP_SOURCE_SEEK_WRITE, /* set position for writing */ + ZIP_SOURCE_TELL_WRITE, /* get write position */ + ZIP_SOURCE_SUPPORTS, /* check whether source supports command */ + ZIP_SOURCE_REMOVE, /* remove file */ + ZIP_SOURCE_RESERVED_1, /* previously used internally */ + ZIP_SOURCE_BEGIN_WRITE_CLONING, /* like ZIP_SOURCE_BEGIN_WRITE, but keep part of original file */ + ZIP_SOURCE_ACCEPT_EMPTY, /* whether empty files are valid archives */ + ZIP_SOURCE_GET_FILE_ATTRIBUTES /* get additional file attributes */ +}; +typedef enum zip_source_cmd zip_source_cmd_t; + +#define ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd) (((zip_int64_t)1) << (cmd)) + +#define ZIP_SOURCE_CHECK_SUPPORTED(supported, cmd) (((supported) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd)) != 0) + +/* clang-format off */ + +#define ZIP_SOURCE_SUPPORTS_READABLE (ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_OPEN) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_READ) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_CLOSE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_STAT) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ERROR) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_FREE)) + +#define ZIP_SOURCE_SUPPORTS_SEEKABLE (ZIP_SOURCE_SUPPORTS_READABLE \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_TELL) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SUPPORTS)) + +#define ZIP_SOURCE_SUPPORTS_WRITABLE (ZIP_SOURCE_SUPPORTS_SEEKABLE \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_BEGIN_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_COMMIT_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ROLLBACK_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_TELL_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_REMOVE)) + +/* clang-format on */ + +/* for use by sources */ +struct zip_source_args_seek { + zip_int64_t offset; + int whence; +}; + +typedef struct zip_source_args_seek zip_source_args_seek_t; +#define ZIP_SOURCE_GET_ARGS(type, data, len, error) ((len) < sizeof(type) ? zip_error_set((error), ZIP_ER_INVAL, 0), (type *)NULL : (type *)(data)) + + +/* error information */ +/* use zip_error_*() to access */ +struct zip_error { + int zip_err; /* libzip error code (ZIP_ER_*) */ + int sys_err; /* copy of errno (E*) or zlib error code */ + char *_Nullable str; /* string representation or NULL */ +}; + +#define ZIP_STAT_NAME 0x0001u +#define ZIP_STAT_INDEX 0x0002u +#define ZIP_STAT_SIZE 0x0004u +#define ZIP_STAT_COMP_SIZE 0x0008u +#define ZIP_STAT_MTIME 0x0010u +#define ZIP_STAT_CRC 0x0020u +#define ZIP_STAT_COMP_METHOD 0x0040u +#define ZIP_STAT_ENCRYPTION_METHOD 0x0080u +#define ZIP_STAT_FLAGS 0x0100u + +struct zip_stat { + zip_uint64_t valid; /* which fields have valid values */ + const char *_Nullable name; /* name of the file */ + zip_uint64_t index; /* index within archive */ + zip_uint64_t size; /* size of file (uncompressed) */ + zip_uint64_t comp_size; /* size of file (compressed) */ + time_t mtime; /* modification time */ + zip_uint32_t crc; /* crc of file data */ + zip_uint16_t comp_method; /* compression method used */ + zip_uint16_t encryption_method; /* encryption method used */ + zip_uint32_t flags; /* reserved for future use */ +}; + +struct zip_buffer_fragment { + zip_uint8_t *_Nonnull data; + zip_uint64_t length; +}; + +struct zip_file_attributes { + zip_uint64_t valid; /* which fields have valid values */ + zip_uint8_t version; /* version of this struct, currently 1 */ + zip_uint8_t host_system; /* host system on which file was created */ + zip_uint8_t ascii; /* flag whether file is ASCII text */ + zip_uint8_t version_needed; /* minimum version needed to extract file */ + zip_uint32_t external_file_attributes; /* external file attributes (host-system specific) */ + zip_uint16_t general_purpose_bit_flags; /* general purpose big flags, only some bits are honored */ + zip_uint16_t general_purpose_bit_mask; /* which bits in general_purpose_bit_flags are valid */ +}; + +#define ZIP_FILE_ATTRIBUTES_HOST_SYSTEM 0x0001u +#define ZIP_FILE_ATTRIBUTES_ASCII 0x0002u +#define ZIP_FILE_ATTRIBUTES_VERSION_NEEDED 0x0004u +#define ZIP_FILE_ATTRIBUTES_EXTERNAL_FILE_ATTRIBUTES 0x0008u +#define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS 0x0010u + +struct zip; +struct zip_file; +struct zip_source; + +typedef struct zip zip_t; +typedef struct zip_error zip_error_t; +typedef struct zip_file zip_file_t; +typedef struct zip_file_attributes zip_file_attributes_t; +typedef struct zip_source zip_source_t; +typedef struct zip_stat zip_stat_t; +typedef struct zip_buffer_fragment zip_buffer_fragment_t; + +typedef zip_uint32_t zip_flags_t; + +typedef zip_int64_t (*zip_source_callback)(void *_Nullable, void *_Nullable, zip_uint64_t, zip_source_cmd_t); +typedef void (*zip_progress_callback)(zip_t *_Nonnull, double, void *_Nullable); +typedef int (*zip_cancel_callback)(zip_t *_Nonnull, void *_Nullable); + +#ifndef ZIP_DISABLE_DEPRECATED +typedef void (*zip_progress_callback_t)(double); +ZIP_EXTERN void zip_register_progress_callback(zip_t *_Nonnull, zip_progress_callback_t _Nullable); /* use zip_register_progress_callback_with_state */ + +ZIP_EXTERN zip_int64_t zip_add(zip_t *_Nonnull, const char *_Nonnull, zip_source_t *_Nonnull); /* use zip_file_add */ +ZIP_EXTERN zip_int64_t zip_add_dir(zip_t *_Nonnull, const char *_Nonnull); /* use zip_dir_add */ +ZIP_EXTERN const char *_Nullable zip_get_file_comment(zip_t *_Nonnull, zip_uint64_t, int *_Nullable, int); /* use zip_file_get_comment */ +ZIP_EXTERN int zip_get_num_files(zip_t *_Nonnull); /* use zip_get_num_entries instead */ +ZIP_EXTERN int zip_rename(zip_t *_Nonnull, zip_uint64_t, const char *_Nonnull); /* use zip_file_rename */ +ZIP_EXTERN int zip_replace(zip_t *_Nonnull, zip_uint64_t, zip_source_t *_Nonnull); /* use zip_file_replace */ +ZIP_EXTERN int zip_set_file_comment(zip_t *_Nonnull, zip_uint64_t, const char *_Nullable, int); /* use zip_file_set_comment */ +ZIP_EXTERN int zip_error_get_sys_type(int); /* use zip_error_system_type */ +ZIP_EXTERN void zip_error_get(zip_t *_Nonnull, int *_Nullable, int *_Nullable); /* use zip_get_error, zip_error_code_zip / zip_error_code_system */ +ZIP_EXTERN int zip_error_to_str(char *_Nonnull, zip_uint64_t, int, int); /* use zip_error_init_with_code / zip_error_strerror */ +ZIP_EXTERN void zip_file_error_get(zip_file_t *_Nonnull, int *_Nullable, int *_Nullable); /* use zip_file_get_error, zip_error_code_zip / zip_error_code_system */ +#endif + +ZIP_EXTERN int zip_close(zip_t *_Nonnull); +ZIP_EXTERN int zip_delete(zip_t *_Nonnull, zip_uint64_t); +ZIP_EXTERN zip_int64_t zip_dir_add(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t); +ZIP_EXTERN void zip_discard(zip_t *_Nonnull); + +ZIP_EXTERN zip_error_t *_Nonnull zip_get_error(zip_t *_Nonnull); +ZIP_EXTERN void zip_error_clear(zip_t *_Nonnull); +ZIP_EXTERN int zip_error_code_zip(const zip_error_t *_Nonnull); +ZIP_EXTERN int zip_error_code_system(const zip_error_t *_Nonnull); +ZIP_EXTERN void zip_error_fini(zip_error_t *_Nonnull); +ZIP_EXTERN void zip_error_init(zip_error_t *_Nonnull); +ZIP_EXTERN void zip_error_init_with_code(zip_error_t *_Nonnull, int); +ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int); +ZIP_EXTERN const char *_Nonnull zip_error_strerror(zip_error_t *_Nonnull); +ZIP_EXTERN int zip_error_system_type(const zip_error_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_error_to_data(const zip_error_t *_Nonnull, void *_Nonnull, zip_uint64_t); + +ZIP_EXTERN int zip_fclose(zip_file_t *_Nonnull); +ZIP_EXTERN zip_t *_Nullable zip_fdopen(int, int, int *_Nullable); +ZIP_EXTERN zip_int64_t zip_file_add(zip_t *_Nonnull, const char *_Nonnull, zip_source_t *_Nonnull, zip_flags_t); +ZIP_EXTERN void zip_file_attributes_init(zip_file_attributes_t *_Nonnull); +ZIP_EXTERN void zip_file_error_clear(zip_file_t *_Nonnull); +ZIP_EXTERN int zip_file_extra_field_delete(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_flags_t); +ZIP_EXTERN int zip_file_extra_field_delete_by_id(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_flags_t); +ZIP_EXTERN int zip_file_extra_field_set(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, const zip_uint8_t *_Nullable, zip_uint16_t, zip_flags_t); +ZIP_EXTERN zip_int16_t zip_file_extra_fields_count(zip_t *_Nonnull, zip_uint64_t, zip_flags_t); +ZIP_EXTERN zip_int16_t zip_file_extra_fields_count_by_id(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_flags_t); +ZIP_EXTERN const zip_uint8_t *_Nullable zip_file_extra_field_get(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t *_Nullable, zip_uint16_t *_Nullable, zip_flags_t); +ZIP_EXTERN const zip_uint8_t *_Nullable zip_file_extra_field_get_by_id(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_uint16_t *_Nullable, zip_flags_t); +ZIP_EXTERN const char *_Nullable zip_file_get_comment(zip_t *_Nonnull, zip_uint64_t, zip_uint32_t *_Nullable, zip_flags_t); +ZIP_EXTERN zip_error_t *_Nonnull zip_file_get_error(zip_file_t *_Nonnull); +ZIP_EXTERN int zip_file_get_external_attributes(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint8_t *_Nullable, zip_uint32_t *_Nullable); +ZIP_EXTERN int zip_file_is_seekable(zip_file_t *_Nonnull); +ZIP_EXTERN int zip_file_rename(zip_t *_Nonnull, zip_uint64_t, const char *_Nonnull, zip_flags_t); +ZIP_EXTERN int zip_file_replace(zip_t *_Nonnull, zip_uint64_t, zip_source_t *_Nonnull, zip_flags_t); +ZIP_EXTERN int zip_file_set_comment(zip_t *_Nonnull, zip_uint64_t, const char *_Nullable, zip_uint16_t, zip_flags_t); +ZIP_EXTERN int zip_file_set_dostime(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_flags_t); +ZIP_EXTERN int zip_file_set_encryption(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, const char *_Nullable); +ZIP_EXTERN int zip_file_set_external_attributes(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint8_t, zip_uint32_t); +ZIP_EXTERN int zip_file_set_mtime(zip_t *_Nonnull, zip_uint64_t, time_t, zip_flags_t); +ZIP_EXTERN const char *_Nonnull zip_file_strerror(zip_file_t *_Nonnull); +ZIP_EXTERN zip_file_t *_Nullable zip_fopen(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t); +ZIP_EXTERN zip_file_t *_Nullable zip_fopen_encrypted(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t, const char *_Nullable); +ZIP_EXTERN zip_file_t *_Nullable zip_fopen_index(zip_t *_Nonnull, zip_uint64_t, zip_flags_t); +ZIP_EXTERN zip_file_t *_Nullable zip_fopen_index_encrypted(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, const char *_Nullable); +ZIP_EXTERN zip_int64_t zip_fread(zip_file_t *_Nonnull, void *_Nonnull, zip_uint64_t); +ZIP_EXTERN zip_int8_t zip_fseek(zip_file_t *_Nonnull, zip_int64_t, int); +ZIP_EXTERN zip_int64_t zip_ftell(zip_file_t *_Nonnull); +ZIP_EXTERN const char *_Nullable zip_get_archive_comment(zip_t *_Nonnull, int *_Nullable, zip_flags_t); +ZIP_EXTERN int zip_get_archive_flag(zip_t *_Nonnull, zip_flags_t, zip_flags_t); +ZIP_EXTERN const char *_Nullable zip_get_name(zip_t *_Nonnull, zip_uint64_t, zip_flags_t); +ZIP_EXTERN zip_int64_t zip_get_num_entries(zip_t *_Nonnull, zip_flags_t); +ZIP_EXTERN const char *_Nonnull zip_libzip_version(void); +ZIP_EXTERN zip_int64_t zip_name_locate(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t); +ZIP_EXTERN zip_t *_Nullable zip_open(const char *_Nonnull, int, int *_Nullable); +ZIP_EXTERN zip_t *_Nullable zip_open_from_source(zip_source_t *_Nonnull, int, zip_error_t *_Nullable); +ZIP_EXTERN int zip_register_progress_callback_with_state(zip_t *_Nonnull, double, zip_progress_callback _Nullable, void (*_Nullable)(void *_Nullable), void *_Nullable); +ZIP_EXTERN int zip_register_cancel_callback_with_state(zip_t *_Nonnull, zip_cancel_callback _Nullable, void (*_Nullable)(void *_Nullable), void *_Nullable); +ZIP_EXTERN int zip_set_archive_comment(zip_t *_Nonnull, const char *_Nullable, zip_uint16_t); +ZIP_EXTERN int zip_set_archive_flag(zip_t *_Nonnull, zip_flags_t, int); +ZIP_EXTERN int zip_set_default_password(zip_t *_Nonnull, const char *_Nullable); +ZIP_EXTERN int zip_set_file_compression(zip_t *_Nonnull, zip_uint64_t, zip_int32_t, zip_uint32_t); +ZIP_EXTERN int zip_source_begin_write(zip_source_t *_Nonnull); +ZIP_EXTERN int zip_source_begin_write_cloning(zip_source_t *_Nonnull, zip_uint64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer(zip_t *_Nonnull, const void *_Nullable, zip_uint64_t, int); +ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_create(const void *_Nullable, zip_uint64_t, int, zip_error_t *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_fragment(zip_t *_Nonnull, const zip_buffer_fragment_t *_Nonnull, zip_uint64_t, int); +ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_fragment_create(const zip_buffer_fragment_t *_Nullable, zip_uint64_t, int, zip_error_t *_Nullable); +ZIP_EXTERN int zip_source_close(zip_source_t *_Nonnull); +ZIP_EXTERN int zip_source_commit_write(zip_source_t *_Nonnull); +ZIP_EXTERN zip_error_t *_Nonnull zip_source_error(zip_source_t *_Nonnull); +ZIP_EXTERN zip_source_t *_Nullable zip_source_file(zip_t *_Nonnull, const char *_Nonnull, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_file_create(const char *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_filep(zip_t *_Nonnull, FILE *_Nonnull, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_filep_create(FILE *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN void zip_source_free(zip_source_t *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_function(zip_t *_Nonnull, zip_source_callback _Nonnull, void *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_function_create(zip_source_callback _Nonnull, void *_Nullable, zip_error_t *_Nullable); +ZIP_EXTERN int zip_source_get_file_attributes(zip_source_t *_Nonnull, zip_file_attributes_t *_Nonnull); +ZIP_EXTERN int zip_source_is_deleted(zip_source_t *_Nonnull); +ZIP_EXTERN void zip_source_keep(zip_source_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_source_make_command_bitmap(zip_source_cmd_t, ...); +ZIP_EXTERN int zip_source_open(zip_source_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_source_read(zip_source_t *_Nonnull, void *_Nonnull, zip_uint64_t); +ZIP_EXTERN void zip_source_rollback_write(zip_source_t *_Nonnull); +ZIP_EXTERN int zip_source_seek(zip_source_t *_Nonnull, zip_int64_t, int); +ZIP_EXTERN zip_int64_t zip_source_seek_compute_offset(zip_uint64_t, zip_uint64_t, void *_Nonnull, zip_uint64_t, zip_error_t *_Nullable); +ZIP_EXTERN int zip_source_seek_write(zip_source_t *_Nonnull, zip_int64_t, int); +ZIP_EXTERN int zip_source_stat(zip_source_t *_Nonnull, zip_stat_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_source_tell(zip_source_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_source_tell_write(zip_source_t *_Nonnull); +#ifdef _WIN32 +ZIP_EXTERN zip_source_t *zip_source_win32a(zip_t *, const char *, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *zip_source_win32a_create(const char *, zip_uint64_t, zip_int64_t, zip_error_t *); +ZIP_EXTERN zip_source_t *zip_source_win32handle(zip_t *, void *, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *zip_source_win32handle_create(void *, zip_uint64_t, zip_int64_t, zip_error_t *); +ZIP_EXTERN zip_source_t *zip_source_win32w(zip_t *, const wchar_t *, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *zip_source_win32w_create(const wchar_t *, zip_uint64_t, zip_int64_t, zip_error_t *); +#endif +ZIP_EXTERN zip_source_t *_Nullable zip_source_window_create(zip_source_t *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN zip_int64_t zip_source_write(zip_source_t *_Nonnull, const void *_Nullable, zip_uint64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_zip(zip_t *_Nonnull, zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_zip_create(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN int zip_stat(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t, zip_stat_t *_Nonnull); +ZIP_EXTERN int zip_stat_index(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_stat_t *_Nonnull); +ZIP_EXTERN void zip_stat_init(zip_stat_t *_Nonnull); +ZIP_EXTERN const char *_Nonnull zip_strerror(zip_t *_Nonnull); +ZIP_EXTERN int zip_unchange(zip_t *_Nonnull, zip_uint64_t); +ZIP_EXTERN int zip_unchange_all(zip_t *_Nonnull); +ZIP_EXTERN int zip_unchange_archive(zip_t *_Nonnull); +ZIP_EXTERN int zip_compression_method_supported(zip_int32_t method, int compress); +ZIP_EXTERN int zip_encryption_method_supported(zip_uint16_t method, int encode); + +#ifdef __cplusplus +} +#endif + +#endif /* _HAD_ZIP_H */ diff --git a/NorthstarDLL/include/libzip/include/zipconf.h b/NorthstarDLL/include/libzip/include/zipconf.h new file mode 100644 index 000000000..8c03513a5 --- /dev/null +++ b/NorthstarDLL/include/libzip/include/zipconf.h @@ -0,0 +1,51 @@ +#ifndef _HAD_ZIPCONF_H +#define _HAD_ZIPCONF_H + +/* + zipconf.h -- platform specific include file + + This file was generated automatically by CMake + based on ../cmake-zipconf.h.in. + */ + +#define LIBZIP_VERSION "1.9.2" +#define LIBZIP_VERSION_MAJOR 1 +#define LIBZIP_VERSION_MINOR 9 +#define LIBZIP_VERSION_MICRO 2 + +/* #undef ZIP_STATIC */ + +#define _Nullable +#define _Nonnull + +#if !defined(__STDC_FORMAT_MACROS) +#define __STDC_FORMAT_MACROS 1 +#endif +#include + +typedef int8_t zip_int8_t; +typedef uint8_t zip_uint8_t; +typedef int16_t zip_int16_t; +typedef uint16_t zip_uint16_t; +typedef int32_t zip_int32_t; +typedef uint32_t zip_uint32_t; +typedef int64_t zip_int64_t; +typedef uint64_t zip_uint64_t; + +#define ZIP_INT8_MIN (-ZIP_INT8_MAX-1) +#define ZIP_INT8_MAX 0x7f +#define ZIP_UINT8_MAX 0xff + +#define ZIP_INT16_MIN (-ZIP_INT16_MAX-1) +#define ZIP_INT16_MAX 0x7fff +#define ZIP_UINT16_MAX 0xffff + +#define ZIP_INT32_MIN (-ZIP_INT32_MAX-1L) +#define ZIP_INT32_MAX 0x7fffffffL +#define ZIP_UINT32_MAX 0xffffffffLU + +#define ZIP_INT64_MIN (-ZIP_INT64_MAX-1LL) +#define ZIP_INT64_MAX 0x7fffffffffffffffLL +#define ZIP_UINT64_MAX 0xffffffffffffffffULL + +#endif /* zipconf.h */ diff --git a/NorthstarDLL/include/libzip/include/zlib.h b/NorthstarDLL/include/libzip/include/zlib.h new file mode 100644 index 000000000..953cb5012 --- /dev/null +++ b/NorthstarDLL/include/libzip/include/zlib.h @@ -0,0 +1,1935 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.13, October 13th, 2022 + + Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 + (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). +*/ + +#ifndef ZLIB_H +#define ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.2.13" +#define ZLIB_VERNUM 0x12d0 +#define ZLIB_VER_MAJOR 1 +#define ZLIB_VER_MINOR 2 +#define ZLIB_VER_REVISION 13 +#define ZLIB_VER_SUBREVISION 0 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed data. + This version of the library supports only one compression method (deflation) + but other algorithms will be added later and will have the same stream + interface. + + Compression can be done in a single step if the buffers are large enough, + or can be done by repeated calls of the compression function. In the latter + case, the application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip and raw deflate streams in + memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never crash + even in the case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + z_const Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total number of input bytes read so far */ + + Bytef *next_out; /* next output byte will go here */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total number of bytes output so far */ + + z_const char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text + for deflate, or the decoding state for inflate */ + uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + +/* + The application must update next_in and avail_in when avail_in has dropped + to zero. It must update next_out and avail_out when avail_out has dropped + to zero. The application must initialize zalloc, zfree and opaque before + calling the init function. All other fields are set by the compression + library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. In that case, zlib is thread-safe. When zalloc and zfree are + Z_NULL on entry to the initialization function, they are set to internal + routines that use the standard library functions malloc() and free(). + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this if + the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers + returned by zalloc for objects of exactly 65536 bytes *must* have their + offset normalized to zero. The default allocation function provided by this + library ensures this (see zutil.c). To reduce memory requirements and avoid + any allocation of 64K objects, at the expense of compression ratio, compile + the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or progress + reports. After compression, total_in holds the total size of the + uncompressed data and may be saved for use by the decompressor (particularly + if the decompressor wants to decompress everything in a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +#define Z_TREES 6 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field for deflate() */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is not + compatible with the zlib.h header file used by the application. This check + is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. If + zalloc and zfree are set to Z_NULL, deflateInit updates them to use default + allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at all + (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION + requests a default compromise between speed and compression (currently + equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if level is not a valid compression level, or + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). msg is set to null + if there is no error message. deflateInit does not perform any compression: + this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Generate more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary. Some output may be provided even if + flush is zero. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating avail_in or avail_out accordingly; avail_out should + never be zero before the call. The application can consume the compressed + output when it wants, for example when the output buffer is full (avail_out + == 0), or after each call of deflate(). If deflate returns Z_OK and with + zero avail_out, it must be called again after making room in the output + buffer because there might be more output pending. See deflatePending(), + which can be used if desired to determine whether or not there is more output + in that case. + + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumulate before producing output, in order to + maximize compression. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In + particular avail_in is zero after the call if enough output space has been + provided before the call.) Flushing may degrade compression for some + compression algorithms and so it should be used only when necessary. This + completes the current deflate block and follows it with an empty stored block + that is three bits plus filler bits to the next byte, followed by four bytes + (00 00 ff ff). + + If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the + output buffer, but the output is not aligned to a byte boundary. All of the + input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. + This completes the current deflate block and follows it with an empty fixed + codes block that is 10 bits long. This assures that enough bytes are output + in order for the decompressor to finish the block before the empty fixed + codes block. + + If flush is set to Z_BLOCK, a deflate block is completed and emitted, as + for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to + seven bits of the current block are held to be written as the next byte after + the next deflate block is completed. In this case, the decompressor may not + be provided enough bits at this point in order to complete decompression of + the data provided so far to the compressor. It may need to wait for the next + block to be emitted. This is for advanced applications that need to control + the emission of deflate blocks. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that + avail_out is greater than six to avoid repeated flush markers due to + avail_out == 0 on return. + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there was + enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this + function must be called again with Z_FINISH and more output space (updated + avail_out) but no more input data, until it returns with Z_STREAM_END or an + error. After deflate has returned Z_STREAM_END, the only possible operations + on the stream are deflateReset or deflateEnd. + + Z_FINISH can be used in the first deflate call after deflateInit if all the + compression is to be done in a single step. In order to complete in one + call, avail_out must be at least the value returned by deflateBound (see + below). Then deflate is guaranteed to return Z_STREAM_END. If not enough + output space is provided, deflate will not return Z_STREAM_END, and it must + be called again as described above. + + deflate() sets strm->adler to the Adler-32 checksum of all input read + so far (that is, total_in bytes). If a gzip stream is being generated, then + strm->adler will be the CRC-32 checksum of the input read so far. (See + deflateInit2 below.) + + deflate() may update strm->data_type if it can make a good guess about + the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is + considered binary. This field is only for information purposes and does not + affect the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was Z_NULL or the state was inadvertently written over + by the application), or Z_BUF_ERROR if no progress is possible (for example + avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and + deflate() can be called again with more input and more output space to + continue compressing. +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, msg + may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. In the current version of inflate, the provided input is not + read or consumed. The allocation of a sliding window will be deferred to + the first call of inflate (if the decompression does not complete on the + first call). If zalloc and zfree are set to Z_NULL, inflateInit updates + them to use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit does not perform any decompression. + Actual decompression will be done by inflate(). So next_in, and avail_in, + next_out, and avail_out are unused and unchanged. The current + implementation of inflateInit() does not process any header information -- + that is deferred until inflate() is called. +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), then next_in and avail_in are updated + accordingly, and processing will resume at this point for the next call of + inflate(). + + - Generate more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there is + no more input data or no more space in the output buffer (see below about + the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating the next_* and avail_* values accordingly. If the + caller of inflate() does not provide both available input and available + output space, it is possible that there will be no progress made. The + application can consume the uncompressed output when it wants, for example + when the output buffer is full (avail_out == 0), or after each call of + inflate(). If inflate returns Z_OK and with zero avail_out, it must be + called again after making room in the output buffer because there might be + more output pending. + + The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, + Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much + output as possible to the output buffer. Z_BLOCK requests that inflate() + stop if and when it gets to the next deflate block boundary. When decoding + the zlib or gzip format, this will cause inflate() to return immediately + after the header and before the first block. When doing a raw inflate, + inflate() will go ahead and process the first block, and will return when it + gets to the end of that block, or when it runs out of data. + + The Z_BLOCK option assists in appending to or combining deflate streams. + To assist in this, on return inflate() always sets strm->data_type to the + number of unused bits in the last byte taken from strm->next_in, plus 64 if + inflate() is currently decoding the last block in the deflate stream, plus + 128 if inflate() returned immediately after decoding an end-of-block code or + decoding the complete header up to just before the first byte of the deflate + stream. The end-of-block will not be indicated until all of the uncompressed + data from that block has been written to strm->next_out. The number of + unused bits may in general be greater than seven, except when bit 7 of + data_type is set, in which case the number of unused bits will be less than + eight. data_type is set as noted here every time inflate() returns for all + flush options, and so can be used to determine the amount of currently + consumed input in bits. + + The Z_TREES option behaves as Z_BLOCK does, but it also returns when the + end of each deflate block header is reached, before any actual data in that + block is decoded. This allows the caller to determine the length of the + deflate block header for later use in random access within a deflate block. + 256 is added to the value of strm->data_type when inflate() returns + immediately after reaching the end of the deflate block header. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step (a + single call of inflate), the parameter flush should be set to Z_FINISH. In + this case all pending input is processed and all pending output is flushed; + avail_out must be large enough to hold all of the uncompressed data for the + operation to complete. (The size of the uncompressed data may have been + saved by the compressor for this purpose.) The use of Z_FINISH is not + required to perform an inflation in one step. However it may be used to + inform inflate that a faster approach can be used for the single inflate() + call. Z_FINISH also informs inflate to not maintain a sliding window if the + stream completes, which reduces inflate's memory footprint. If the stream + does not complete, either because not all of the stream is provided or not + enough output space is provided, then a sliding window will be allocated and + inflate() can be called again to continue the operation as if Z_NO_FLUSH had + been used. + + In this implementation, inflate() always flushes as much output as + possible to the output buffer, and always uses the faster approach on the + first call. So the effects of the flush parameter in this implementation are + on the return value of inflate() as noted below, when inflate() returns early + when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of + memory for a sliding window when Z_FINISH is used. + + If a preset dictionary is needed after this call (see inflateSetDictionary + below), inflate sets strm->adler to the Adler-32 checksum of the dictionary + chosen by the compressor and returns Z_NEED_DICT; otherwise it sets + strm->adler to the Adler-32 checksum of all output produced so far (that is, + total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described + below. At the end of the stream, inflate() checks that its computed Adler-32 + checksum is equal to that saved by the compressor and returns Z_STREAM_END + only if the checksum is correct. + + inflate() can decompress and check either zlib-wrapped or gzip-wrapped + deflate data. The header type is detected automatically, if requested when + initializing with inflateInit2(). Any information contained in the gzip + header is not retained unless inflateGetHeader() is used. When processing + gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output + produced so far. The CRC-32 is checked against the gzip trailer, as is the + uncompressed length, modulo 2^32. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect check + value, in which case strm->msg points to a string with a more specific + error), Z_STREAM_ERROR if the stream structure was inconsistent (for example + next_in or next_out was Z_NULL, or the state was inadvertently written over + by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR + if no progress was possible or if there was not enough room in the output + buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + inflate() can be called again with more input and more output space to + continue decompressing. If Z_DATA_ERROR is returned, the application may + then call inflateSync() to look for a good compression block if a partial + recovery of the data is to be attempted. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state + was inconsistent. +*/ + + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields zalloc, zfree and opaque must be initialized before by the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + For the current implementation of deflate(), a windowBits value of 8 (a + window size of 256 bytes) is not supported. As a result, a request for 8 + will result in 9 (a 512-byte window). In that case, providing 8 to + inflateInit2() will result in an error when the zlib header with 9 is + checked against the initialization of inflate(). The remedy is to not use 8 + with deflateInit2() with this initialization, or at least in that case use 9 + with inflateInit2(). + + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits + determines the window size. deflate() will then generate raw deflate data + with no zlib header or trailer, and will not compute a check value. + + windowBits can also be greater than 15 for optional gzip encoding. Add + 16 to windowBits to write a simple gzip header and trailer around the + compressed data instead of a zlib wrapper. The gzip header will have no + file name, no extra data, no comment, no modification time (set to zero), no + header crc, and the operating system will be set to the appropriate value, + if the operating system was determined at compile time. If a gzip stream is + being written, strm->adler is a CRC-32 instead of an Adler-32. + + For raw deflate or gzip encoding, a request for a 256-byte window is + rejected as invalid, since only the zlib header provides a means of + transmitting the window size to the decompressor. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but is + slow and reduces compression ratio; memLevel=9 uses maximum memory for + optimal speed. The default value is 8. See zconf.h for total memory usage + as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match), or Z_RLE to limit match distances to one (run-length + encoding). Filtered data consists mostly of small values with a somewhat + random distribution. In this case, the compression algorithm is tuned to + compress them better. The effect of Z_FILTERED is to force more Huffman + coding and less string matching; it is somewhat intermediate between + Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as + fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The + strategy parameter only affects the compression ratio but not the + correctness of the compressed output even if it is not set appropriately. + Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler + decoder for special applications. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid + method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is + incompatible with the version assumed by the caller (ZLIB_VERSION). msg is + set to null if there is no error message. deflateInit2 does not perform any + compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. When using the zlib format, this + function must be called immediately after deflateInit, deflateInit2 or + deflateReset, and before any call of deflate. When doing raw deflate, this + function must be called either before any call of deflate, or immediately + after the completion of a deflate block, i.e. after all input has been + consumed and all output has been delivered when using any of the flush + options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The + compressor and decompressor must use exactly the same dictionary (see + inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size + provided in deflateInit or deflateInit2. Thus the strings most likely to be + useful should be put at the end of the dictionary, not at the front. In + addition, the current implementation of deflate will use at most the window + size minus 262 bytes of the provided dictionary. + + Upon return of this function, strm->adler is set to the Adler-32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler-32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) If a raw deflate was requested, then the + Adler-32 value is not computed and strm->adler is not set. + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if not at a block boundary for raw deflate). deflateSetDictionary does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by deflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If deflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similarly, if dictLength is Z_NULL, then it is not set. + + deflateGetDictionary() may return a length less than the window size, even + when more than the window size in input has been provided. It may return up + to 258 bytes less in that case, due to how zlib's implementation of deflate + manages the sliding window and lookahead for matches, where matches can be + up to 258 bytes long. If the application needs the last window-size bytes of + input, then that would need to be saved by the application outside of zlib. + + deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and can + consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, but + does not free and reallocate the internal compression state. The stream + will leave the compression level and any other attributes that may have been + set unchanged. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2(). This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different strategy. + If the compression approach (which is a function of the level) or the + strategy is changed, and if there have been any deflate() calls since the + state was initialized or reset, then the input available so far is + compressed with the old level and strategy using deflate(strm, Z_BLOCK). + There are three approaches for the compression levels 0, 1..3, and 4..9 + respectively. The new level and strategy will take effect at the next call + of deflate(). + + If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does + not have enough output space to complete, then the parameter change will not + take effect. In this case, deflateParams() can be called again with the + same parameters and more output space to try again. + + In order to assure a change in the parameters on the first try, the + deflate stream should be flushed using deflate() with Z_BLOCK or other flush + request until strm.avail_out is not zero, before calling deflateParams(). + Then no more input data should be provided before the deflateParams() call. + If this is done, the old level and strategy will be applied to the data + compressed before deflateParams(), and the new level and strategy will be + applied to the the data compressed after deflateParams(). + + deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream + state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if + there was not enough output space to complete the compression of the + available input data before a change in the strategy or approach. Note that + in the case of a Z_BUF_ERROR, the parameters are not changed. A return + value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be + retried with more output space. +*/ + +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +/* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, + uLong sourceLen)); +/* + deflateBound() returns an upper bound on the compressed size after + deflation of sourceLen bytes. It must be called after deflateInit() or + deflateInit2(), and after deflateSetHeader(), if used. This would be used + to allocate an output buffer for deflation in a single pass, and so would be + called before deflate(). If that first deflate() call is provided the + sourceLen input bytes, an output buffer allocated to the size returned by + deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed + to return Z_STREAM_END. Note that it is possible for the compressed size to + be larger than the value returned by deflateBound() if flush options other + than Z_FINISH or Z_NO_FLUSH are used. +*/ + +ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, + unsigned *pending, + int *bits)); +/* + deflatePending() returns the number of bytes and bits of output that have + been generated, but not yet provided in the available output. The bytes not + provided would be due to the available output space having being consumed. + The number of bits of output not provided are between 0 and 7, where they + await more bits to join them in order to fill out a full byte. If pending + or bits are Z_NULL, then those values are not set. + + deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. + */ + +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + deflatePrime() inserts bits in the deflate output stream. The intent + is that this function is used to start off the deflate output with the bits + leftover from a previous deflate stream when appending to it. As such, this + function can only be used for raw deflate, and must be used before the first + deflate() call after a deflateInit2() or deflateReset(). bits must be less + than or equal to 16, and that many of the least significant bits of value + will be inserted in the output. + + deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough + room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +/* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. windowBits must be greater than or equal to the windowBits value + provided to deflateInit2() while compressing, or it must be equal to 15 if + deflateInit2() was not used. If a compressed stream with a larger window + size is given as input, inflate() will return with the error code + Z_DATA_ERROR instead of trying to allocate a larger window. + + windowBits can also be zero to request that inflate use the window size in + the zlib header of the compressed stream. + + windowBits can also be -8..-15 for raw inflate. In this case, -windowBits + determines the window size. inflate() will then process raw deflate data, + not looking for a zlib or gzip header, not generating a check value, and not + looking for any check values for comparison at the end of the stream. This + is for use with other formats that use the deflate compressed data format + such as zip. Those formats provide their own check values. If a custom + format is developed using the raw deflate format for compressed data, it is + recommended that a check value such as an Adler-32 or a CRC-32 be applied to + the uncompressed data as is done in the zlib, gzip, and zip formats. For + most applications, the zlib format should be used as is. Note that comments + above on the use in deflateInit2() applies to the magnitude of windowBits. + + windowBits can also be greater than 15 for optional gzip decoding. Add + 32 to windowBits to enable zlib and gzip decoding with automatic header + detection, or add 16 to decode only the gzip format (the zlib format will + return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a + CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see + below), inflate() will *not* automatically decode concatenated gzip members. + inflate() will return Z_STREAM_END at the end of the gzip member. The state + would need to be reset to continue decoding a subsequent gzip member. This + *must* be done if there is more data after a gzip member, in order for the + decompression to be compliant with the gzip standard (RFC 1952). + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit2 does not perform any decompression + apart from possibly reading the zlib header if present: actual decompression + will be done by inflate(). (So next_in and avail_in may be modified, but + next_out and avail_out are unused and unchanged.) The current implementation + of inflateInit2() does not process any header information -- that is + deferred until inflate() is called. +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate, + if that call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler-32 value returned by that call of inflate. + The compressor and decompressor must use exactly the same dictionary (see + deflateSetDictionary). For raw inflate, this function can be called at any + time to set the dictionary. If the provided dictionary is smaller than the + window and there is already data in the window, then the provided dictionary + will amend what's there. The application must insure that the dictionary + that was used for compression is provided. + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler-32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by inflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If inflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similarly, if dictLength is Z_NULL, then it is not set. + + inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a possible full flush point (see above + for the description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync searches for a 00 00 FF FF pattern in the compressed data. + All full flush points have this pattern, but not all occurrences of this + pattern are full flush points. + + inflateSync returns Z_OK if a possible full flush point has been found, + Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point + has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. + In the success case, the application may save the current current value of + total_in which indicates where valid compressed data was found. In the + error case, the application may repeatedly call inflateSync, providing more + input each time, until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when randomly accessing a large stream. The + first pass through the stream can periodically record the inflate state, + allowing restarting inflate at those points when randomly accessing the + stream. + + inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate the internal decompression state. The + stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, + int windowBits)); +/* + This function is the same as inflateReset, but it also permits changing + the wrap and window size requests. The windowBits parameter is interpreted + the same as it is for inflateInit2. If the window size is changed, then the + memory allocated for the window is freed, and the window will be reallocated + by inflate() if needed. + + inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL), or if + the windowBits parameter is invalid. +*/ + +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + This function inserts bits in the inflate input stream. The intent is + that this function is used to start inflating at a bit position in the + middle of a byte. The provided bits will be used before any bytes are used + from next_in. This function should only be used with raw inflate, and + should be used before the first inflate() call after inflateInit2() or + inflateReset(). bits must be less than or equal to 16, and that many of the + least significant bits of value will be inserted in the input. + + If bits is negative, then the input stream bit buffer is emptied. Then + inflatePrime() can be called again to put bits in the buffer. This is used + to clear out bits leftover after feeding inflate a block description prior + to feeding inflate codes. + + inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); +/* + This function returns two values, one in the lower 16 bits of the return + value, and the other in the remaining upper bits, obtained by shifting the + return value down 16 bits. If the upper value is -1 and the lower value is + zero, then inflate() is currently decoding information outside of a block. + If the upper value is -1 and the lower value is non-zero, then inflate is in + the middle of a stored block, with the lower value equaling the number of + bytes from the input remaining to copy. If the upper value is not -1, then + it is the number of bits back from the current bit position in the input of + the code (literal or length/distance pair) currently being processed. In + that case the lower value is the number of bytes already emitted for that + code. + + A code is being processed if inflate is waiting for more input to complete + decoding of the code, or if it has completed decoding but is waiting for + more output space to write the literal or match data. + + inflateMark() is used to mark locations in the input data for random + access, which may be at bit positions, and to note those cases where the + output of a code may span boundaries of random access blocks. The current + location in the input stream can be determined from avail_in and data_type + as noted in the description for the Z_BLOCK flush parameter for inflate. + + inflateMark returns the value noted above, or -65536 if the provided + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + gz_headerp head)); +/* + inflateGetHeader() requests that gzip header information be stored in the + provided gz_header structure. inflateGetHeader() may be called after + inflateInit2() or inflateReset(), and before the first call of inflate(). + As inflate() processes the gzip stream, head->done is zero until the header + is completed, at which time head->done is set to one. If a zlib stream is + being decoded, then head->done is set to -1 to indicate that there will be + no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be + used to force inflate() to return immediately after header processing is + complete and before any actual data is decompressed. + + The text, time, xflags, and os fields are filled in with the gzip header + contents. hcrc is set to true if there is a header CRC. (The header CRC + was valid if done is set to one.) If extra is not Z_NULL, then extra_max + contains the maximum number of bytes to write to extra. Once done is true, + extra_len contains the actual extra field length, and extra contains the + extra field, or that field truncated if extra_max is less than extra_len. + If name is not Z_NULL, then up to name_max characters are written there, + terminated with a zero unless the length is greater than name_max. If + comment is not Z_NULL, then up to comm_max characters are written there, + terminated with a zero unless the length is greater than comm_max. When any + of extra, name, or comment are not Z_NULL and the respective field is not + present in the header, then that field is set to Z_NULL to signal its + absence. This allows the use of deflateSetHeader() with the returned + structure to duplicate the header. However if those fields are set to + allocated memory, then the application will need to save those pointers + elsewhere so that they can be eventually freed. + + If inflateGetHeader is not used, then the header information is simply + discarded. The header is always checked for validity, including the header + CRC if present. inflateReset() will reset the process to discard the header + information. The application would need to call inflateGetHeader() again to + retrieve the header from the next gzip stream. + + inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, + unsigned char FAR *window)); + + Initialize the internal stream state for decompression using inflateBack() + calls. The fields zalloc, zfree and opaque in strm must be initialized + before the call. If zalloc and zfree are Z_NULL, then the default library- + derived memory allocation routines are used. windowBits is the base two + logarithm of the window size, in the range 8..15. window is a caller + supplied buffer of that size. Except for special applications where it is + assured that deflate was used with small window sizes, windowBits must be 15 + and a 32K byte window must be supplied to be able to decompress general + deflate streams. + + See inflateBack() for the usage of these routines. + + inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of + the parameters are invalid, Z_MEM_ERROR if the internal state could not be + allocated, or Z_VERSION_ERROR if the version of the library does not match + the version of the header file. +*/ + +typedef unsigned (*in_func) OF((void FAR *, + z_const unsigned char FAR * FAR *)); +typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); + +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +/* + inflateBack() does a raw inflate with a single call using a call-back + interface for input and output. This is potentially more efficient than + inflate() for file i/o applications, in that it avoids copying between the + output and the sliding window by simply making the window itself the output + buffer. inflate() can be faster on modern CPUs when used with large + buffers. inflateBack() trusts the application to not change the output + buffer passed by the output function, at least until inflateBack() returns. + + inflateBackInit() must be called first to allocate the internal state + and to initialize the state with the user-provided window buffer. + inflateBack() may then be used multiple times to inflate a complete, raw + deflate stream with each call. inflateBackEnd() is then called to free the + allocated state. + + A raw deflate stream is one with no zlib or gzip header or trailer. + This routine would normally be used in a utility that reads zip or gzip + files and writes out uncompressed files. The utility would decode the + header and process the trailer on its own, hence this routine expects only + the raw deflate stream to decompress. This is different from the default + behavior of inflate(), which expects a zlib header and trailer around the + deflate stream. + + inflateBack() uses two subroutines supplied by the caller that are then + called by inflateBack() for input and output. inflateBack() calls those + routines until it reads a complete deflate stream and writes out all of the + uncompressed data, or until it encounters an error. The function's + parameters and return types are defined above in the in_func and out_func + typedefs. inflateBack() will call in(in_desc, &buf) which should return the + number of bytes of provided input, and a pointer to that input in buf. If + there is no input available, in() must return zero -- buf is ignored in that + case -- and inflateBack() will return a buffer error. inflateBack() will + call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. + out() should return zero on success, or non-zero on failure. If out() + returns non-zero, inflateBack() will return with an error. Neither in() nor + out() are permitted to change the contents of the window provided to + inflateBackInit(), which is also the buffer that out() uses to write from. + The length written by out() will be at most the window size. Any non-zero + amount of input may be provided by in(). + + For convenience, inflateBack() can be provided input on the first call by + setting strm->next_in and strm->avail_in. If that input is exhausted, then + in() will be called. Therefore strm->next_in must be initialized before + calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called + immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in + must also be initialized, and then if strm->avail_in is not zero, input will + initially be taken from strm->next_in[0 .. strm->avail_in - 1]. + + The in_desc and out_desc parameters of inflateBack() is passed as the + first parameter of in() and out() respectively when they are called. These + descriptors can be optionally used to pass any information that the caller- + supplied in() and out() functions need to do their job. + + On return, inflateBack() will set strm->next_in and strm->avail_in to + pass back any unused input that was provided by the last in() call. The + return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR + if in() or out() returned an error, Z_DATA_ERROR if there was a format error + in the deflate stream (in which case strm->msg is set to indicate the nature + of the error), or Z_STREAM_ERROR if the stream was not properly initialized. + In the case of Z_BUF_ERROR, an input or output error can be distinguished + using strm->next_in which will be Z_NULL only if in() returned an error. If + strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning + non-zero. (in() will always be called before out(), so strm->next_in is + assured to be defined if out() returns non-zero.) Note that inflateBack() + cannot return Z_OK. +*/ + +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +/* + All memory allocated by inflateBackInit() is freed. + + inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream + state was inconsistent. +*/ + +ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +/* Return flags indicating compile-time options. + + Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: + 1.0: size of uInt + 3.2: size of uLong + 5.4: size of voidpf (pointer) + 7.6: size of z_off_t + + Compiler, assembler, and debug options: + 8: ZLIB_DEBUG + 9: ASMV or ASMINF -- use ASM code + 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention + 11: 0 (reserved) + + One-time table building (smaller code, but not thread-safe if true): + 12: BUILDFIXED -- build static block decoding tables when needed + 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed + 14,15: 0 (reserved) + + Library content (indicates missing functionality): + 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking + deflate code when not needed) + 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect + and decode gzip streams (to avoid linking crc code) + 18-19: 0 (reserved) + + Operation variations (changes in library functionality): + 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate + 21: FASTEST -- deflate algorithm with only one, lowest compression level + 22,23: 0 (reserved) + + The sprintf variant used by gzprintf (zero is best): + 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format + 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! + 26: 0 = returns value, 1 = void -- 1 means inferred string length returned + + Remainder: + 27-31: 0 (reserved) + */ + +#ifndef Z_SOLO + + /* utility functions */ + +/* + The following utility functions are implemented on top of the basic + stream-oriented functions. To simplify the interface, some default options + are assumed (compression level and memory usage, standard memory allocation + functions). The source code of these utility functions can be modified if + you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed data. compress() is equivalent to compress2() with a level + parameter of Z_DEFAULT_COMPRESSION. + + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed data. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +/* + compressBound() returns an upper bound on the compressed size after + compress() or compress2() on sourceLen bytes. It would be used before a + compress() or compress2() call to allocate the destination buffer. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be large enough to hold the entire + uncompressed data. (The size of the uncompressed data must have been saved + previously by the compressor and transmitted to the decompressor by some + mechanism outside the scope of this compression library.) Upon exit, destLen + is the actual size of the uncompressed data. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In + the case where there is not enough room, uncompress() will fill the output + buffer with the uncompressed data up to that point. +*/ + +ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen)); +/* + Same as uncompress, except that sourceLen is a pointer, where the + length of the source is *sourceLen. On return, *sourceLen is the number of + source bytes consumed. +*/ + + /* gzip file access functions */ + +/* + This library supports reading and writing files in gzip (.gz) format with + an interface similar to that of stdio, using the functions that start with + "gz". The gzip format is different from the zlib format. gzip is a gzip + wrapper, documented in RFC 1952, wrapped around a deflate stream. +*/ + +typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ + +/* +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); + + Open the gzip (.gz) file at path for reading and decompressing, or + compressing and writing. The mode parameter is as in fopen ("rb" or "wb") + but can also include a compression level ("wb9") or a strategy: 'f' for + filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", + 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression + as in "wb9F". (See the description of deflateInit2 for more information + about the strategy parameter.) 'T' will request transparent writing or + appending with no compression and not using the gzip format. + + "a" can be used instead of "w" to request that the gzip stream that will + be written be appended to the file. "+" will result in an error, since + reading and writing to the same gzip file is not supported. The addition of + "x" when writing will create the file exclusively, which fails if the file + already exists. On systems that support it, the addition of "e" when + reading or writing will set the flag to close the file on an execve() call. + + These functions, as well as gzip, will read and decode a sequence of gzip + streams in a file. The append function of gzopen() can be used to create + such a file. (Also see gzflush() for another way to do this.) When + appending, gzopen does not test whether the file begins with a gzip stream, + nor does it look for the end of the gzip streams to begin appending. gzopen + will simply append a gzip stream to the existing file. + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. When + reading, this will be detected automatically by looking for the magic two- + byte gzip header. + + gzopen returns NULL if the file could not be opened, if there was + insufficient memory to allocate the gzFile state, or if an invalid mode was + specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). + errno can be checked to determine if the reason gzopen failed was that the + file could not be opened. +*/ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + Associate a gzFile with the file descriptor fd. File descriptors are + obtained from calls like open, dup, creat, pipe or fileno (if the file has + been previously opened with fopen). The mode parameter is as in gzopen. + + The next call of gzclose on the returned gzFile will also close the file + descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor + fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, + mode);. The duplicated descriptor should be saved to avoid a leak, since + gzdopen does not close fd if it fails. If you are using fileno() to get the + file descriptor from a FILE *, then you will have to use dup() to avoid + double-close()ing the file descriptor. Both gzclose() and fclose() will + close the associated file descriptor, so they need to have different file + descriptors. + + gzdopen returns NULL if there was insufficient memory to allocate the + gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not + provided, or '+' was provided), or if fd is -1. The file descriptor is not + used until the next gz* read, write, seek, or close operation, so gzdopen + will not detect if fd is invalid (unless fd is -1). +*/ + +ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); +/* + Set the internal buffer size used by this library's functions for file to + size. The default buffer size is 8192 bytes. This function must be called + after gzopen() or gzdopen(), and before any other calls that read or write + the file. The buffer memory allocation is always deferred to the first read + or write. Three times that size in buffer space is allocated. A larger + buffer size of, for example, 64K or 128K bytes will noticeably increase the + speed of decompression (reading). + + The new buffer size also affects the maximum length for gzprintf(). + + gzbuffer() returns 0 on success, or -1 on failure, such as being called + too late. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level and strategy for file. See the + description of deflateInit2 for the meaning of these parameters. Previously + provided data is flushed before applying the parameter changes. + + gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not + opened for writing, Z_ERRNO if there is an error writing the flushed data, + or Z_MEM_ERROR if there is a memory allocation error. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Read and decompress up to len uncompressed bytes from file into buf. If + the input file is not in gzip format, gzread copies the given number of + bytes into the buffer directly from the file. + + After reaching the end of a gzip stream in the input, gzread will continue + to read, looking for another gzip stream. Any number of gzip streams may be + concatenated in the input file, and will all be decompressed by gzread(). + If something other than a gzip stream is encountered after a gzip stream, + that remaining trailing garbage is ignored (and no error is returned). + + gzread can be used to read a gzip file that is being concurrently written. + Upon reaching the end of the input, gzread will return with the available + data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then + gzclearerr can be used to clear the end of file indicator in order to permit + gzread to be tried again. Z_OK indicates that a gzip stream was completed + on the last gzread. Z_BUF_ERROR indicates that the input file ended in the + middle of a gzip stream. Note that gzread does not return -1 in the event + of an incomplete gzip stream. This error is deferred until gzclose(), which + will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip + stream. Alternatively, gzerror can be used before gzclose to detect this + case. + + gzread returns the number of uncompressed bytes actually read, less than + len for end of file, or -1 for error. If len is too large to fit in an int, + then nothing is read, -1 is returned, and the error state is set to + Z_STREAM_ERROR. +*/ + +ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, + gzFile file)); +/* + Read and decompress up to nitems items of size size from file into buf, + otherwise operating as gzread() does. This duplicates the interface of + stdio's fread(), with size_t request and return types. If the library + defines size_t, then z_size_t is identical to size_t. If not, then z_size_t + is an unsigned integer type that can contain a pointer. + + gzfread() returns the number of full items read of size size, or zero if + the end of the file was reached and a full item could not be read, or if + there was an error. gzerror() must be consulted if zero is returned in + order to determine if there was an error. If the multiplication of size and + nitems overflows, i.e. the product does not fit in a z_size_t, then nothing + is read, zero is returned, and the error state is set to Z_STREAM_ERROR. + + In the event that the end of file is reached and only a partial item is + available at the end, i.e. the remaining uncompressed data length is not a + multiple of size, then the final partial item is nevertheless read into buf + and the end-of-file flag is set. The length of the partial item read is not + provided, but could be inferred from the result of gztell(). This behavior + is the same as the behavior of fread() implementations in common libraries, + but it prevents the direct use of gzfread() to read a concurrently written + file, resetting and retrying on end-of-file, when size is not 1. +*/ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); +/* + Compress and write the len uncompressed bytes at buf to file. gzwrite + returns the number of uncompressed bytes written or 0 in case of error. +*/ + +ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, + z_size_t nitems, gzFile file)); +/* + Compress and write nitems items of size size from buf to file, duplicating + the interface of stdio's fwrite(), with size_t request and return types. If + the library defines size_t, then z_size_t is identical to size_t. If not, + then z_size_t is an unsigned integer type that can contain a pointer. + + gzfwrite() returns the number of full items written of size size, or zero + if there was an error. If the multiplication of size and nitems overflows, + i.e. the product does not fit in a z_size_t, then nothing is written, zero + is returned, and the error state is set to Z_STREAM_ERROR. +*/ + +ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); +/* + Convert, format, compress, and write the arguments (...) to file under + control of the string format, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written, or a negative zlib error code in case + of error. The number of uncompressed bytes written is limited to 8191, or + one less than the buffer size given to gzbuffer(). The caller should assure + that this limit is not exceeded. If it is exceeded, then gzprintf() will + return an error (0) with nothing written. In this case, there may also be a + buffer overflow with unpredictable consequences, which is possible only if + zlib was compiled with the insecure functions sprintf() or vsprintf(), + because the secure snprintf() or vsnprintf() functions were not available. + This can be determined using zlibCompileFlags(). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Compress and write the given null-terminated string s to file, excluding + the terminating null character. + + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Read and decompress bytes from file into buf, until len-1 characters are + read, or until a newline character is read and transferred to buf, or an + end-of-file condition is encountered. If any characters are read or if len + is one, the string is terminated with a null character. If no characters + are read due to an end-of-file or len is less than one, then the buffer is + left untouched. + + gzgets returns buf which is a null-terminated string, or it returns NULL + for end-of-file or in case of error. If there was an error, the contents at + buf are indeterminate. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Compress and write c, converted to an unsigned char, into file. gzputc + returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Read and decompress one byte from file. gzgetc returns this byte or -1 + in case of end of file or error. This is implemented as a macro for speed. + As such, it does not do all of the checking the other functions do. I.e. + it does not check to see if file is NULL, nor whether the structure file + points to has been clobbered or not. +*/ + +ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +/* + Push c back onto the stream for file to be read as the first character on + the next read. At least one character of push-back is always allowed. + gzungetc() returns the character pushed, or -1 on failure. gzungetc() will + fail if c is -1, and may fail if a character has been pushed but not read + yet. If gzungetc is used immediately after gzopen or gzdopen, at least the + output buffer size of pushed characters is allowed. (See gzbuffer above.) + The pushed character will be discarded if the stream is repositioned with + gzseek() or gzrewind(). +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flush all pending output to file. The parameter flush is as in the + deflate() function. The return value is the zlib error number (see function + gzerror below). gzflush is only permitted when writing. + + If the flush parameter is Z_FINISH, the remaining data is written and the + gzip stream is completed in the output. If gzwrite() is called again, a new + gzip stream will be started in the output. gzread() is able to read such + concatenated gzip streams. + + gzflush should be called only when strictly necessary because it will + degrade compression if called too often. +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); + + Set the starting position to offset relative to whence for the next gzread + or gzwrite on file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewind file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET). +*/ + +/* +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); + + Return the starting position for the next gzread or gzwrite on file. + This position represents a number of bytes in the uncompressed data stream, + and is zero when starting, even if appending or reading a gzip stream from + the middle of a file using gzdopen(). + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); + + Return the current compressed (actual) read or write offset of file. This + offset includes the count of bytes that precede the gzip stream, for example + when appending or when using gzdopen() for reading. When reading, the + offset does not include as yet unused buffered input. This information can + be used for a progress indicator. On error, gzoffset() returns -1. +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Return true (1) if the end-of-file indicator for file has been set while + reading, false (0) otherwise. Note that the end-of-file indicator is set + only if the read tried to go past the end of the input, but came up short. + Therefore, just like feof(), gzeof() may return false even if there is no + more data to read, in the event that the last read request was for the exact + number of bytes remaining in the input file. This will happen if the input + file size is an exact multiple of the buffer size. + + If gzeof() returns true, then the read functions will return no more data, + unless the end-of-file indicator is reset by gzclearerr() and the input file + has grown since the previous end of file was detected. +*/ + +ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +/* + Return true (1) if file is being copied directly while reading, or false + (0) if file is a gzip stream being decompressed. + + If the input file is empty, gzdirect() will return true, since the input + does not contain a gzip stream. + + If gzdirect() is used immediately after gzopen() or gzdopen() it will + cause buffers to be allocated to allow reading the file to determine if it + is a gzip file. Therefore if gzbuffer() is used, it should be called before + gzdirect(). + + When writing, gzdirect() returns true (1) if transparent writing was + requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: + gzdirect() is not needed when writing. Transparent writing must be + explicitly requested, so the application already knows the answer. When + linking statically, using gzdirect() will include all of the zlib code for + gzip file reading and decompression, which may not be desired.) +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flush all pending output for file, if necessary, close file and + deallocate the (de)compression state. Note that once file is closed, you + cannot call gzerror with file, since its structures have been deallocated. + gzclose must not be called more than once on the same file, just as free + must not be called more than once on the same allocation. + + gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a + file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the + last read ended in the middle of a gzip stream, or Z_OK on success. +*/ + +ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); +/* + Same as gzclose(), but gzclose_r() is only for use when reading, and + gzclose_w() is only for use when writing or appending. The advantage to + using these instead of gzclose() is that they avoid linking in zlib + compression or decompression code that is not used when only reading or only + writing respectively. If gzclose() is used, then both compression and + decompression code will be included the application when linking to a static + zlib library. +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Return the error message for the last error which occurred on file. + errnum is set to zlib error number. If an error occurred in the file system + and not in the compression library, errnum is set to Z_ERRNO and the + application may consult errno to get the exact error code. + + The application must not modify the returned string. Future calls to + this function may invalidate the previously returned string. If file is + closed, then the string previously returned by gzerror will no longer be + available. + + gzerror() should be used to distinguish errors from end-of-file for those + functions above that do not distinguish those cases in their return values. +*/ + +ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +/* + Clear the error and end-of-file flags for file. This is analogous to the + clearerr() function in stdio. This is useful for continuing to read a gzip + file that is being written concurrently. +*/ + +#endif /* !Z_SOLO */ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the compression + library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. An Adler-32 value is in the range of a 32-bit + unsigned integer. If buf is Z_NULL, this function returns the required + initial value for the checksum. + + An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed + much faster. + + Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, + z_size_t len)); +/* + Same as adler32(), but with a size_t length. +*/ + +/* +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); + + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note + that the z_off_t type (like off_t) is a signed integer. If len2 is + negative, the result has no meaning or utility. +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running CRC-32 with the bytes buf[0..len-1] and return the + updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. + If buf is Z_NULL, this function returns the required initial value for the + crc. Pre- and post-conditioning (one's complement) is performed within this + function so it shouldn't be done by the application. + + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, + z_size_t len)); +/* + Same as crc32(), but with a size_t length. +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); + + Return the operator corresponding to length len2, to be used with + crc32_combine_op(). +*/ + +ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); +/* + Give the same result as crc32_combine(), using op in place of len2. op is + is generated from len2 by crc32_combine_gen(). This will be faster than + crc32_combine() if the generated op is used more than once. +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size)); +#ifdef Z_PREFIX_SET +# define z_deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define z_inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#else +# define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#endif + +#ifndef Z_SOLO + +/* gzgetc() macro and its supporting function and exposed data structure. Note + * that the real internal state is much larger than the exposed structure. + * This abbreviated structure exposes just enough for the gzgetc() macro. The + * user should not mess with these exposed elements, since their names or + * behavior could change in the future, perhaps even capriciously. They can + * only be used by the gzgetc() macro. You have been warned. + */ +struct gzFile_s { + unsigned have; + unsigned char *next; + z_off64_t pos; +}; +ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +#ifdef Z_PREFIX_SET +# undef z_gzgetc +# define z_gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#else +# define gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#endif + +/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or + * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if + * both are true, the application gets the *64 functions, and the regular + * functions are changed to 64 bits) -- in case these are set on systems + * without large file support, _LFS64_LARGEFILE must also be true + */ +#ifdef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); +#endif + +#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) +# ifdef Z_PREFIX_SET +# define z_gzopen z_gzopen64 +# define z_gzseek z_gzseek64 +# define z_gztell z_gztell64 +# define z_gzoffset z_gzoffset64 +# define z_adler32_combine z_adler32_combine64 +# define z_crc32_combine z_crc32_combine64 +# define z_crc32_combine_gen z_crc32_combine_gen64 +# else +# define gzopen gzopen64 +# define gzseek gzseek64 +# define gztell gztell64 +# define gzoffset gzoffset64 +# define adler32_combine adler32_combine64 +# define crc32_combine crc32_combine64 +# define crc32_combine_gen crc32_combine_gen64 +# endif +# ifndef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); +# endif +#else + ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); +#endif + +#else /* Z_SOLO */ + + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + +#endif /* !Z_SOLO */ + +/* undocumented functions */ +ZEXTERN const char * ZEXPORT zError OF((int)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); +ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); +ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); +ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp)); +ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); +ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); +#if defined(_WIN32) && !defined(Z_SOLO) +ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, + const char *mode)); +#endif +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifndef Z_SOLO +ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, + const char *format, + va_list va)); +# endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ZLIB_H */ diff --git a/NorthstarDLL/include/libzip/lib/bz2.lib b/NorthstarDLL/include/libzip/lib/bz2.lib new file mode 100644 index 0000000000000000000000000000000000000000..54e3a9aef44b0fa8a79af87ca9d638002cab926c GIT binary patch literal 6224 zcmb_gYiL|W6h3*hF-eo`CfTG93mY0R1{%|3leAXL_Jzi#Nl7;m{Nd)Y8@rNZ<8DHs zrC3Btu{D4Fp$LVdg5a+fp?{1)3Wc`TD#eHoC_zdIKBE5&#B=7{xihnOqP^)}I6HUF zIWynPoX4EI4bKf{Mo;W3dnRl?J9n9V*=u!PcJ12J$*)6Y0MHIldLN*C1)!n@Ah4UM zY79WoZETT(rWU2`R5LNd$bOl?a-~*=Gc>toC^A0Uxi&Q(vRCyLa&@#42 zb=R2c8v%$yvrP3kUJ#D0N2>N?9zA>@V^~{^Q2BoT2(VrYn^i3rvjX7N=BUAU_csiT(C^1)Q zy^x$9n4HNb&ArojB~jX*>6{(BoJmb5J&RIYo4y^9tq`l=P9Gvb|0Xrh4U zJTNmh7E9Bw^crJ?MVvcMSzwKkngWjzY(1%qV?kB~Vm&7gIR z)d&X5PLd@IA#+$dHa?R*VMv+7(ov7cFo&hdOeUQ%#xlouo@;A$^V~K}boWaER>}cd zDgbr|0LH2SZX=xv0$j#^CAQ%jfSziAD@YHpKVJ)Q9(hYhgZO?Hv)(e&wK{;tdVtvw z%CTKS8bn?*_Lq?`sX{f>zy{a|#qb1_LJ3qrIc$P5sDc0lp%S)29c+UwPzxcbhs{s` zg}%oWt?hq&n9B1!{^NQoYs#)l0FomTAS-z$Q4BRs@wAZ?>CR&5RSz`k+me8YbH)|1 zsOJEEyb-9HzBXR>FWtl0vv`c|q4pqRJxdVyyma)-L>WjPx8eFqtWMQXu#S?<+%zxw zo-1vQ$rU?yCMEIAB`mFPQQ13}tE`?Y5w_Er>;WDQ`+=Qp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&9ewm~JQunP~&x@C8FWF02D-4$T=qVj6 zM;__A|77f=_wm&ROMg#gpmZ(S6?8l^?szswJTq1zlJ83`J@f^vokJU*ee%A8qzyF| zN;>Ds6{DYkd(M%6U5hBb&&w__pW)JhUpCb3Bps+D1lNE2Tqu@f&3;z<$k()Hs~Agt I18cVCe|!TI*Z=?k literal 0 HcmV?d00001 diff --git a/NorthstarDLL/include/libzip/share/bzip2/copyright b/NorthstarDLL/include/libzip/share/bzip2/copyright new file mode 100644 index 000000000..81a37eab7 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/bzip2/copyright @@ -0,0 +1,42 @@ + +-------------------------------------------------------------------------- + +This program, "bzip2", the associated library "libbzip2", and all +documentation, are copyright (C) 1996-2019 Julian R Seward. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Julian Seward, jseward@acm.org +bzip2/libbzip2 version 1.0.8 of 13 July 2019 + +-------------------------------------------------------------------------- diff --git a/NorthstarDLL/include/libzip/share/bzip2/usage b/NorthstarDLL/include/libzip/share/bzip2/usage new file mode 100644 index 000000000..b2a3e97d5 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/bzip2/usage @@ -0,0 +1,4 @@ +The package bzip2 is compatible with built-in CMake targets: + + find_package(BZip2 REQUIRED) + target_link_libraries(main PRIVATE BZip2::BZip2) diff --git a/NorthstarDLL/include/libzip/share/bzip2/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/bzip2/vcpkg.spdx.json new file mode 100644 index 000000000..cc51cdba6 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/bzip2/vcpkg.spdx.json @@ -0,0 +1,204 @@ +{ + "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", + "spdxVersion": "SPDX-2.2", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "documentNamespace": "https://spdx.org/spdxdocs/bzip2-x64-windows-1.0.8#3-f705dfa4-60f8-4c9e-a288-4e283dd5bc33", + "name": "bzip2:x64-windows@1.0.8#3 29cfbc197d4db4bb665618ce7fc151833568137d7835176633c5dd5012bbeeef", + "creationInfo": { + "creators": [ + "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" + ], + "created": "2022-11-21T10:26:35Z" + }, + "relationships": [ + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "GENERATES", + "relatedSpdxElement": "SPDXRef-binary" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-0" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-1" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-2" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-3" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-4" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-5" + }, + { + "spdxElementId": "SPDXRef-binary", + "relationshipType": "GENERATED_FROM", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-0", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-1", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-2", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-3", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-4", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-5", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-5", + "relationshipType": "DEPENDENCY_MANIFEST_OF", + "relatedSpdxElement": "SPDXRef-port" + } + ], + "packages": [ + { + "name": "bzip2", + "SPDXID": "SPDXRef-port", + "versionInfo": "1.0.8#3", + "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/bzip2", + "homepage": "https://sourceware.org/bzip2/", + "licenseConcluded": "bzip2-1.0.6", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "description": "bzip2 is a freely available, patent free, high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression.", + "comment": "This is the port (recipe) consumed by vcpkg." + }, + { + "name": "bzip2:x64-windows", + "SPDXID": "SPDXRef-binary", + "versionInfo": "29cfbc197d4db4bb665618ce7fc151833568137d7835176633c5dd5012bbeeef", + "downloadLocation": "NONE", + "licenseConcluded": "bzip2-1.0.6", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "comment": "This is a binary package built by vcpkg." + }, + { + "SPDXID": "SPDXRef-resource-1", + "name": "bzip2-${BZIP2_VERSION}.tar.gz", + "packageFileName": "bzip2-${BZIP2_VERSION}.tar.gz", + "downloadLocation": "https://sourceware.org/pub/bzip2/bzip2-${BZIP2_VERSION}.tar.gz", + "licenseConcluded": "NOASSERTION", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA512", + "checksumValue": "083f5e675d73f3233c7930ebe20425a533feedeaaa9d8cc86831312a6581cefbe6ed0d08d2fa89be81082f2a5abdabca8b3c080bf97218a1bd59dc118a30b9f3" + } + ] + } + ], + "files": [ + { + "fileName": "./bzip2.pc.in", + "SPDXID": "SPDXRef-file-0", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "ec5bae2705896aa6f2ac5eb2b02c5512568203808c8427484b5eef1da670df91" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./CMakeLists.txt", + "SPDXID": "SPDXRef-file-1", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "4f14b283a0be8ae8ad8a6c6db288ff5ffe3af6d82506fac266532b11ea9a8a33" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./fix-import-export-macros.patch", + "SPDXID": "SPDXRef-file-2", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "38918c1257c884cc5cde39d9f4235d0e71574f20c7e5ec686a506612f647495e" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./portfile.cmake", + "SPDXID": "SPDXRef-file-3", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "ffef2f051e412a3fd1ef78cd18439c113f8ae4d0d49e581f19697704331661de" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./usage", + "SPDXID": "SPDXRef-file-4", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "75d339011fc11a43ee5093142ca1e8cb5e54db2ac93822abc5de694cda5a9881" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg.json", + "SPDXID": "SPDXRef-file-5", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "1e3d45a5e6f560a0c49bfba02296c497b7f8d2d0c86006eca511357efe7b86c8" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + } + ] +} diff --git a/NorthstarDLL/include/libzip/share/bzip2/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/bzip2/vcpkg_abi_info.txt new file mode 100644 index 000000000..65174d268 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/bzip2/vcpkg_abi_info.txt @@ -0,0 +1,21 @@ +CMakeLists.txt 4f14b283a0be8ae8ad8a6c6db288ff5ffe3af6d82506fac266532b11ea9a8a33 +bzip2.pc.in ec5bae2705896aa6f2ac5eb2b02c5512568203808c8427484b5eef1da670df91 +cmake 3.24.0 +features core;tool +fix-import-export-macros.patch 38918c1257c884cc5cde39d9f4235d0e71574f20c7e5ec686a506612f647495e +portfile.cmake ffef2f051e412a3fd1ef78cd18439c113f8ae4d0d49e581f19697704331661de +ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 +post_build_checks 2 +powershell 7.3.0 +triplet x64-windows +triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 +usage 75d339011fc11a43ee5093142ca1e8cb5e54db2ac93822abc5de694cda5a9881 +vcpkg-cmake 071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2 +vcpkg-cmake-config 7a89a2c694fe410451262c8f36436ebbcdd0dc5b99f3166c537c5aebdf8623d4 +vcpkg.json 1e3d45a5e6f560a0c49bfba02296c497b7f8d2d0c86006eca511357efe7b86c8 +vcpkg_check_features 3cdc889b7e6965ad5ddab803060aed2019c0177b6f314c7a5a947c01efa4db60 +vcpkg_copy_pdbs d57e4f196c82dc562a9968c6155073094513c31e2de475694143d3aa47954b1c +vcpkg_download_distfile 257c2c17449e740e4553a7adc37fdd80e811045957ff1d86f18c142a290b5865 +vcpkg_extract_source_archive a25e0132b36c30e9675f934042fb1164128864eeefa064ab8eabb1eb347aa381 +vcpkg_extract_source_archive_ex ab9f5bd71a8e1ca4a56d5c09f248c2bc10ff8df3b600c3efb6cca34cba9ec3b7 +vcpkg_fixup_pkgconfig 433d0d235b4e9f6c7bb8744a2f06a9f534b355da67d0d85b7c2daf15c8c77671 diff --git a/NorthstarDLL/include/libzip/share/libzip/copyright b/NorthstarDLL/include/libzip/share/libzip/copyright new file mode 100644 index 000000000..fa7060961 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/libzip/copyright @@ -0,0 +1,31 @@ +Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + +The authors can be contacted at + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-config-version.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-config-version.cmake new file mode 100644 index 000000000..1895c7208 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/libzip/libzip-config-version.cmake @@ -0,0 +1,48 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. +# The variable CVF_VERSION must be set before calling configure_file(). + +set(PACKAGE_VERSION "1.9.2") + +if (PACKAGE_FIND_VERSION_RANGE) + # Package version must be in the requested version range + if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN) + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + endif() +else() + if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed project requested no architecture check, don't perform the check +if("FALSE") + return() +endif() + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-config.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-config.cmake new file mode 100644 index 000000000..7b8b6580c --- /dev/null +++ b/NorthstarDLL/include/libzip/share/libzip/libzip-config.cmake @@ -0,0 +1,47 @@ + +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +####### Any changes to this file will be overwritten by the next CMake run #### +####### The input file was libzip-config.cmake.in ######## + +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE) + +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +#################################################################################### + +# only needed for static library, and doesn't work as-is +include(CMakeFindDependencyMacro) +if(ON) + find_dependency(BZip2) +endif() +if(OFF) + find_dependency(LibLZMA) +endif() +if(OFF) + find_dependency(Zstd) +endif() +if(OFF) + find_dependency(OpenSSL) +endif() +find_dependency(ZLIB) +# how to handle the optional dependencies? +# Provide all our library targets to users. +include("${CMAKE_CURRENT_LIST_DIR}/libzip-targets.cmake") + +check_required_components(libzip) + diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-targets-debug.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-targets-debug.cmake new file mode 100644 index 000000000..e6f881903 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/libzip/libzip-targets-debug.cmake @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Debug". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "libzip::zip" for configuration "Debug" +set_property(TARGET libzip::zip APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) +set_target_properties(libzip::zip PROPERTIES + IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/debug/lib/zip.lib" + IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/bin/zip.dll" + ) + +list(APPEND _cmake_import_check_targets libzip::zip ) +list(APPEND _cmake_import_check_files_for_libzip::zip "${_IMPORT_PREFIX}/debug/lib/zip.lib" "${_IMPORT_PREFIX}/debug/bin/zip.dll" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-targets-release.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-targets-release.cmake new file mode 100644 index 000000000..e4a6ef0a7 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/libzip/libzip-targets-release.cmake @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Release". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "libzip::zip" for configuration "Release" +set_property(TARGET libzip::zip APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(libzip::zip PROPERTIES + IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/zip.lib" + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/zip.dll" + ) + +list(APPEND _cmake_import_check_targets libzip::zip ) +list(APPEND _cmake_import_check_files_for_libzip::zip "${_IMPORT_PREFIX}/lib/zip.lib" "${_IMPORT_PREFIX}/bin/zip.dll" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-targets.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-targets.cmake new file mode 100644 index 000000000..b878c1d01 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/libzip/libzip-targets.cmake @@ -0,0 +1,101 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.0 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.3") + message(FATAL_ERROR "CMake >= 2.8.3 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.3...3.22) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS libzip::zip) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target libzip::zip +add_library(libzip::zip SHARED IMPORTED) + +set_target_properties(libzip::zip PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include" +) + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/libzip-targets-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/NorthstarDLL/include/libzip/share/libzip/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/libzip/vcpkg.spdx.json new file mode 100644 index 000000000..2bba7d4fa --- /dev/null +++ b/NorthstarDLL/include/libzip/share/libzip/vcpkg.spdx.json @@ -0,0 +1,137 @@ +{ + "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", + "spdxVersion": "SPDX-2.2", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "documentNamespace": "https://spdx.org/spdxdocs/libzip-x64-windows-1.9.2-8db99669-09e3-4718-95fb-5e53a4aedcc9", + "name": "libzip:x64-windows@1.9.2 cc7a2dc90d2cfd63165358b4bef8e374bf8323e218fb1879d49e1b8266df33b0", + "creationInfo": { + "creators": [ + "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" + ], + "created": "2022-11-21T10:27:20Z" + }, + "relationships": [ + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "GENERATES", + "relatedSpdxElement": "SPDXRef-binary" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-0" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-1" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-2" + }, + { + "spdxElementId": "SPDXRef-binary", + "relationshipType": "GENERATED_FROM", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-0", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-1", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-2", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-2", + "relationshipType": "DEPENDENCY_MANIFEST_OF", + "relatedSpdxElement": "SPDXRef-port" + } + ], + "packages": [ + { + "name": "libzip", + "SPDXID": "SPDXRef-port", + "versionInfo": "1.9.2", + "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/libzip", + "homepage": "https://github.com/nih-at/libzip", + "licenseConcluded": "BSD-3-Clause", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "description": "A library for reading, creating, and modifying zip archives.", + "comment": "This is the port (recipe) consumed by vcpkg." + }, + { + "name": "libzip:x64-windows", + "SPDXID": "SPDXRef-binary", + "versionInfo": "cc7a2dc90d2cfd63165358b4bef8e374bf8323e218fb1879d49e1b8266df33b0", + "downloadLocation": "NONE", + "licenseConcluded": "BSD-3-Clause", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "comment": "This is a binary package built by vcpkg." + }, + { + "SPDXID": "SPDXRef-resource-1", + "name": "nih-at/libzip", + "downloadLocation": "git+https://github.com/nih-at/libzip@5532f9baa0c44cc5435ad135686a4ea009075b9a", + "licenseConcluded": "NOASSERTION", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA512", + "checksumValue": "1105bc48c8a554a7fce84028197427b02ff53508592889b37e81cc419eb208d91112b98df2bf2d6f5629887e4418230ee36e3bf03c9ae39cdc39cfa90e7e3e7f" + } + ] + } + ], + "files": [ + { + "fileName": "./fix-dependency.patch", + "SPDXID": "SPDXRef-file-0", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "a4a25a61584ec286ba202e8ba87b49eb57eaafa71ef4af1de28cb8d39baccb66" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./portfile.cmake", + "SPDXID": "SPDXRef-file-1", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "eb343ec7c73620b6e8dd421381e1d738da55a791202abff6f3cbb4cbae9cd3ba" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg.json", + "SPDXID": "SPDXRef-file-2", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "eec0f9b1b449b5f3c87d39ee719b4baf3c7b8c278406cade284793c0669d1118" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + } + ] +} diff --git a/NorthstarDLL/include/libzip/share/libzip/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/libzip/vcpkg_abi_info.txt new file mode 100644 index 000000000..eadf8fb7c --- /dev/null +++ b/NorthstarDLL/include/libzip/share/libzip/vcpkg_abi_info.txt @@ -0,0 +1,19 @@ +bzip2 29cfbc197d4db4bb665618ce7fc151833568137d7835176633c5dd5012bbeeef +cmake 3.24.0 +features bzip2;core;default-aes;wincrypto +fix-dependency.patch a4a25a61584ec286ba202e8ba87b49eb57eaafa71ef4af1de28cb8d39baccb66 +portfile.cmake eb343ec7c73620b6e8dd421381e1d738da55a791202abff6f3cbb4cbae9cd3ba +ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 +post_build_checks 2 +powershell 7.3.0 +triplet x64-windows +triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 +vcpkg-cmake 071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2 +vcpkg-cmake-config 7a89a2c694fe410451262c8f36436ebbcdd0dc5b99f3166c537c5aebdf8623d4 +vcpkg.json eec0f9b1b449b5f3c87d39ee719b4baf3c7b8c278406cade284793c0669d1118 +vcpkg_check_features 3cdc889b7e6965ad5ddab803060aed2019c0177b6f314c7a5a947c01efa4db60 +vcpkg_copy_pdbs d57e4f196c82dc562a9968c6155073094513c31e2de475694143d3aa47954b1c +vcpkg_fixup_pkgconfig 433d0d235b4e9f6c7bb8744a2f06a9f534b355da67d0d85b7c2daf15c8c77671 +vcpkg_from_git 42a2f33208e157d5332b7ce93a28fc3948d4c0be78cacc8013a5d6ce06eaede1 +vcpkg_from_github b743742296a114ea1b18ae99672e02f142c4eb2bef7f57d36c038bedbfb0502f +zlib cfba80992a665d41aa217b6bd51c1720ddab0b5bcdc338feae38235d27cdc83c diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/copyright b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/copyright new file mode 100644 index 000000000..2e4eac826 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/copyright @@ -0,0 +1,23 @@ +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +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. diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg-port-config.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg-port-config.cmake new file mode 100644 index 000000000..980d41131 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg-port-config.cmake @@ -0,0 +1 @@ +include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_config_fixup.cmake") diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg.spdx.json new file mode 100644 index 000000000..c4d5660ea --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg.spdx.json @@ -0,0 +1,165 @@ +{ + "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", + "spdxVersion": "SPDX-2.2", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "documentNamespace": "https://spdx.org/spdxdocs/vcpkg-cmake-config-x64-windows-2022-02-06#1-fbb47e83-e270-46bd-b2f3-ebbf3b1c16e5", + "name": "vcpkg-cmake-config:x64-windows@2022-02-06#1 7a89a2c694fe410451262c8f36436ebbcdd0dc5b99f3166c537c5aebdf8623d4", + "creationInfo": { + "creators": [ + "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" + ], + "created": "2022-11-18T16:00:08Z" + }, + "relationships": [ + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "GENERATES", + "relatedSpdxElement": "SPDXRef-binary" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-0" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-1" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-2" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-3" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-4" + }, + { + "spdxElementId": "SPDXRef-binary", + "relationshipType": "GENERATED_FROM", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-0", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-1", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-2", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-3", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-3", + "relationshipType": "DEPENDENCY_MANIFEST_OF", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-4", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + } + ], + "packages": [ + { + "name": "vcpkg-cmake-config", + "SPDXID": "SPDXRef-port", + "versionInfo": "2022-02-06#1", + "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/vcpkg-cmake-config", + "licenseConcluded": "MIT", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "comment": "This is the port (recipe) consumed by vcpkg." + }, + { + "name": "vcpkg-cmake-config:x64-windows", + "SPDXID": "SPDXRef-binary", + "versionInfo": "7a89a2c694fe410451262c8f36436ebbcdd0dc5b99f3166c537c5aebdf8623d4", + "downloadLocation": "NONE", + "licenseConcluded": "MIT", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "comment": "This is a binary package built by vcpkg." + } + ], + "files": [ + { + "fileName": "./copyright", + "SPDXID": "SPDXRef-file-0", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "04b60f99a43bfd7fefdc8364b24aac704a2160cef969b75ba6a38b62dc4c4b70" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./portfile.cmake", + "SPDXID": "SPDXRef-file-1", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "832b34e63f5af41ad1b2e4aa79c5bfa507a005b120b51548e674accc706837d7" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg-port-config.cmake", + "SPDXID": "SPDXRef-file-2", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "72bc3093337e633bdd19fe5d4dd1f38ca1918def49608d676a9c98c686d38b1e" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg.json", + "SPDXID": "SPDXRef-file-3", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "4ffbabc2feab69abd21267f57669ef5e404bcbfa5ab6d93234374d98f5ff1864" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg_cmake_config_fixup.cmake", + "SPDXID": "SPDXRef-file-4", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "f92905382d90e37fa2addd96becce31f5075175196b117de6dd997a4ac1d6d06" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + } + ] +} diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_abi_info.txt new file mode 100644 index 000000000..03361725e --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_abi_info.txt @@ -0,0 +1,13 @@ +cmake 3.24.0 +copyright 04b60f99a43bfd7fefdc8364b24aac704a2160cef969b75ba6a38b62dc4c4b70 +features core +portfile.cmake 832b34e63f5af41ad1b2e4aa79c5bfa507a005b120b51548e674accc706837d7 +ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 +post_build_checks 2 +powershell 7.3.0 +triplet x64-windows +triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 +vcpkg-port-config.cmake 72bc3093337e633bdd19fe5d4dd1f38ca1918def49608d676a9c98c686d38b1e +vcpkg.json 4ffbabc2feab69abd21267f57669ef5e404bcbfa5ab6d93234374d98f5ff1864 +vcpkg_cmake_config_fixup.cmake f92905382d90e37fa2addd96becce31f5075175196b117de6dd997a4ac1d6d06 +vcpkg_list f5de3ebcbc40a4db90622ade9aca918e2cf404dc0d91342fcde457d730e6fa29 diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake new file mode 100644 index 000000000..368e5809a --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -0,0 +1,258 @@ +include_guard(GLOBAL) + +function(vcpkg_cmake_config_fixup) + cmake_parse_arguments(PARSE_ARGV 0 "arg" "DO_NOT_DELETE_PARENT_CONFIG_PATH;NO_PREFIX_CORRECTION" "PACKAGE_NAME;CONFIG_PATH;TOOLS_PATH" "") + + if(DEFINED arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_cmake_config_fixup was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") + endif() + if(NOT arg_PACKAGE_NAME) + set(arg_PACKAGE_NAME "${PORT}") + endif() + if(NOT arg_CONFIG_PATH) + set(arg_CONFIG_PATH "share/${arg_PACKAGE_NAME}") + endif() + if(NOT arg_TOOLS_PATH) + set(arg_TOOLS_PATH "tools/${PORT}") + endif() + set(target_path "share/${arg_PACKAGE_NAME}") + + string(REPLACE "." "\\." EXECUTABLE_SUFFIX "${VCPKG_TARGET_EXECUTABLE_SUFFIX}") + + set(debug_share "${CURRENT_PACKAGES_DIR}/debug/${target_path}") + set(release_share "${CURRENT_PACKAGES_DIR}/${target_path}") + + if(NOT arg_CONFIG_PATH STREQUAL "share/${arg_PACKAGE_NAME}") + if(arg_CONFIG_PATH STREQUAL "share") + set(arg_CONFIG_PATH z_vcpkg_share) + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/${arg_CONFIG_PATH}") + file(RENAME "${CURRENT_PACKAGES_DIR}/share" "${CURRENT_PACKAGES_DIR}/${arg_CONFIG_PATH}") + endif() + + set(debug_config "${CURRENT_PACKAGES_DIR}/debug/${arg_CONFIG_PATH}") + set(release_config "${CURRENT_PACKAGES_DIR}/${arg_CONFIG_PATH}") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(NOT EXISTS "${debug_config}") + message(FATAL_ERROR "'${debug_config}' does not exist.") + endif() + + # This roundabout handling enables CONFIG_PATH = share + file(MAKE_DIRECTORY "${debug_share}") + file(GLOB files "${debug_config}/*") + file(COPY ${files} DESTINATION "${debug_share}") + file(REMOVE_RECURSE "${debug_config}") + endif() + + file(GLOB files "${release_config}/*") + file(COPY ${files} DESTINATION "${release_share}") + file(REMOVE_RECURSE "${release_config}") + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + get_filename_component(debug_config_dir_name "${debug_config}" NAME) + string(TOLOWER "${debug_config_dir_name}" debug_config_dir_name) + if(debug_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) + file(REMOVE_RECURSE "${debug_config}") + else() + get_filename_component(debug_config_parent_dir "${debug_config}" DIRECTORY) + get_filename_component(debug_config_dir_name "${debug_config_parent_dir}" NAME) + string(TOLOWER "${debug_config_dir_name}" debug_config_dir_name) + if(debug_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) + file(REMOVE_RECURSE "${debug_config_parent_dir}") + endif() + endif() + endif() + + get_filename_component(release_config_dir_name "${release_config}" NAME) + string(TOLOWER "${release_config_dir_name}" release_config_dir_name) + if(release_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) + file(REMOVE_RECURSE "${release_config}") + else() + get_filename_component(release_config_parent_dir "${release_config}" DIRECTORY) + get_filename_component(release_config_dir_name "${release_config_parent_dir}" NAME) + string(TOLOWER "${release_config_dir_name}" release_config_dir_name) + if(release_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) + file(REMOVE_RECURSE "${release_config_parent_dir}") + endif() + endif() + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + if(NOT EXISTS "${debug_share}") + message(FATAL_ERROR "'${debug_share}' does not exist.") + endif() + endif() + + file(GLOB_RECURSE release_targets + "${release_share}/*-release.cmake" + ) + foreach(release_target IN LISTS release_targets) + file(READ "${release_target}" contents) + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" contents "${contents}") + string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" contents "${contents}") + file(WRITE "${release_target}" "${contents}") + endforeach() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(GLOB_RECURSE debug_targets + "${debug_share}/*-debug.cmake" + ) + foreach(debug_target IN LISTS debug_targets) + file(RELATIVE_PATH debug_target_rel "${debug_share}" "${debug_target}") + + file(READ "${debug_target}" contents) + string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" contents "${contents}") + string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \";]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" contents "${contents}") + string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" contents "${contents}") + string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" contents "${contents}") + file(WRITE "${release_share}/${debug_target_rel}" "${contents}") + + file(REMOVE "${debug_target}") + endforeach() + endif() + + #Fix ${_IMPORT_PREFIX} and absolute paths in cmake generated targets and configs; + #Since those can be renamed we have to check in every *.cmake, but only once. + file(GLOB_RECURSE main_cmakes "${release_share}/*.cmake") + if(NOT DEFINED Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP) + vcpkg_list(SET Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP) + endif() + foreach(already_fixed_up IN LISTS Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP) + vcpkg_list(REMOVE_ITEM main_cmakes "${already_fixed_up}") + endforeach() + vcpkg_list(APPEND Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP ${main_cmakes}) + set(Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP "${Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP}" CACHE INTERNAL "") + + foreach(main_cmake IN LISTS main_cmakes) + file(READ "${main_cmake}" contents) + # Note: I think the following comment is no longer true, since we now require the path to be `share/blah` + # however, I don't know it for sure. + # - nimazzuc + + #This correction is not correct for all cases. To make it correct for all cases it needs to consider + #original folder deepness to CURRENT_PACKAGES_DIR in comparison to the moved to folder deepness which + #is always at least (>=) 2, e.g. share/${PORT}. Currently the code assumes it is always 2 although + #this requirement is only true for the *Config.cmake. The targets are not required to be in the same + #folder as the *Config.cmake! + if(NOT arg_NO_PREFIX_CORRECTION) + string(REGEX REPLACE +[[get_filename_component\(_IMPORT_PREFIX "\${CMAKE_CURRENT_LIST_FILE}" PATH\)( +get_filename_component\(_IMPORT_PREFIX "\${_IMPORT_PREFIX}" PATH\))*]] +[[get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] + contents "${contents}") # see #1044 for details why this replacement is necessary. See #4782 why it must be a regex. + string(REGEX REPLACE +[[get_filename_component\(PACKAGE_PREFIX_DIR "\${CMAKE_CURRENT_LIST_DIR}/\.\./(\.\./)*" ABSOLUTE\)]] +[[get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)]] + contents "${contents}") + string(REGEX REPLACE +[[get_filename_component\(PACKAGE_PREFIX_DIR "\${CMAKE_CURRENT_LIST_DIR}/\.\.((\\|/)\.\.)*" ABSOLUTE\)]] +[[get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)]] + contents "${contents}") # This is a meson-related workaround, see https://github.com/mesonbuild/meson/issues/6955 + endif() + + # Merge release and debug configurations of target property INTERFACE_LINK_LIBRARIES. + string(REPLACE "${release_share}/" "${debug_share}/" debug_cmake "${main_cmake}") + if(DEFINED VCPKG_BUILD_TYPE) + # Skip. Warning: A release-only port in a dual-config installation + # may pull release dependencies into the debug configuration. + elseif(NOT contents MATCHES "INTERFACE_LINK_LIBRARIES") + # Skip. No relevant properties. + elseif(NOT contents MATCHES "# Generated CMake target import file\\.") + # Skip. No safe assumptions about a matching debug import file. + elseif(NOT EXISTS "${debug_cmake}") + message(SEND_ERROR "Did not find a debug import file matching '${main_cmake}'") + else() + file(READ "${debug_cmake}" debug_contents) + while(contents MATCHES "set_target_properties\\(([^ \$]*) PROPERTIES[^)]*\\)") + set(matched_command "${CMAKE_MATCH_0}") + string(REPLACE "+" "\\+" target "${CMAKE_MATCH_1}") + if(NOT debug_contents MATCHES "set_target_properties\\(${target} PROPERTIES[^)]*\\)") + message(SEND_ERROR "Did not find a debug configuration for target '${target}'.") + endif() + set(debug_command "${CMAKE_MATCH_0}") + string(REGEX MATCH " INTERFACE_LINK_LIBRARIES \"([^\"]*)\"" release_line "${matched_command}") + set(release_libs "${CMAKE_MATCH_1}") + string(REGEX MATCH " INTERFACE_LINK_LIBRARIES \"([^\"]*)\"" debug_line "${debug_command}") + set(debug_libs "${CMAKE_MATCH_1}") + z_vcpkg_cmake_config_fixup_merge(merged_libs release_libs debug_libs) + string(REPLACE "${release_line}" " INTERFACE_LINK_LIBRARIES \"${merged_libs}\"" updated_command "${matched_command}") + string(REPLACE "set_target_properties" "set_target_properties::done" updated_command "${updated_command}") # Prevend 2nd match + string(REPLACE "${matched_command}" "${updated_command}" contents "${contents}") + endwhile() + string(REPLACE "set_target_properties::done" "set_target_properties" contents "${contents}") # Restore original command + endif() + + #Fix absolute paths to installed dir with ones relative to ${CMAKE_CURRENT_LIST_DIR} + #This happens if vcpkg built libraries are directly linked to a target instead of using + #an imported target. + string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") + file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" cmake_current_packages_dir) + string(REPLACE "${cmake_current_packages_dir}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") + # If ${VCPKG_IMPORT_PREFIX} was actually used, inject a definition of it: + string(FIND "${contents}" [[${VCPKG_IMPORT_PREFIX}]] index) + if (NOT index STREQUAL "-1") + get_filename_component(main_cmake_dir "${main_cmake}" DIRECTORY) + # Calculate relative to be a sequence of "../" + file(RELATIVE_PATH relative "${main_cmake_dir}" "${cmake_current_packages_dir}") + string(PREPEND contents "get_filename_component(VCPKG_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}\/${relative}\" ABSOLUTE)\n") + endif() + + file(WRITE "${main_cmake}" "${contents}") + endforeach() + + file(GLOB_RECURSE unused_files + "${debug_share}/*[Tt]argets.cmake" + "${debug_share}/*[Cc]onfig.cmake" + "${debug_share}/*[Cc]onfigVersion.cmake" + "${debug_share}/*[Cc]onfig-version.cmake" + ) + foreach(unused_file IN LISTS unused_files) + file(REMOVE "${unused_file}") + endforeach() + + # Remove /debug// if it's empty. + file(GLOB_RECURSE remaining_files "${debug_share}/*") + if(remaining_files STREQUAL "") + file(REMOVE_RECURSE "${debug_share}") + endif() + + # Remove /debug/share/ if it's empty. + file(GLOB_RECURSE remaining_files "${CURRENT_PACKAGES_DIR}/debug/share/*") + if(remaining_files STREQUAL "") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + endif() +endfunction() + +# Merges link interface library lists for release and debug +# into a single expression which use generator expression as necessary. +function(z_vcpkg_cmake_config_fixup_merge out_var release_var debug_var) + set(release_libs "VCPKG;${${release_var}}") + string(REGEX REPLACE ";optimized;([^;]*)" ";\\1" release_libs "${release_libs}") + string(REGEX REPLACE ";debug;([^;]*)" ";" release_libs "${release_libs}") + list(REMOVE_AT release_libs 0) + list(FILTER release_libs EXCLUDE REGEX [[^\\[$]<\\[$]:]]) + list(TRANSFORM release_libs REPLACE [[^\\[$]<\\[$]>:(.*)>$]] "\\1") + + set(debug_libs "VCPKG;${${debug_var}}") + string(REGEX REPLACE ";optimized;([^;]*)" ";" debug_libs "${debug_libs}") + string(REGEX REPLACE ";debug;([^;]*)" ";\\1" debug_libs "${debug_libs}") + list(REMOVE_AT debug_libs 0) + list(FILTER debug_libs EXCLUDE REGEX [[^\\[$]<\\[$]>:]]) + list(TRANSFORM debug_libs REPLACE [[^\\[$]<\\[$]:(.*)>$]] "\\1") + + set(merged_libs "") + foreach(release_lib debug_lib IN ZIP_LISTS release_libs debug_libs) + if(release_lib STREQUAL debug_lib) + list(APPEND merged_libs "${release_lib}") + else() + if(release_lib) + list(APPEND merged_libs "\\\$<\\\$>:${release_lib}>") + endif() + if(debug_lib) + list(APPEND merged_libs "\\\$<\\\$:${debug_lib}>") + endif() + endif() + endforeach() + set("${out_var}" "${merged_libs}" PARENT_SCOPE) +endfunction() diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/copyright b/NorthstarDLL/include/libzip/share/vcpkg-cmake/copyright new file mode 100644 index 000000000..2e4eac826 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake/copyright @@ -0,0 +1,23 @@ +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +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. diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg-port-config.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg-port-config.cmake new file mode 100644 index 000000000..f2a973d4e --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg-port-config.cmake @@ -0,0 +1,3 @@ +include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_configure.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_build.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_install.cmake") diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg.spdx.json new file mode 100644 index 000000000..96cfe34ab --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg.spdx.json @@ -0,0 +1,187 @@ +{ + "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", + "spdxVersion": "SPDX-2.2", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "documentNamespace": "https://spdx.org/spdxdocs/vcpkg-cmake-x64-windows-2022-10-30-977ee841-b481-4659-b110-cb500e85eb35", + "name": "vcpkg-cmake:x64-windows@2022-10-30 071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2", + "creationInfo": { + "creators": [ + "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" + ], + "created": "2022-11-18T16:00:07Z" + }, + "relationships": [ + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "GENERATES", + "relatedSpdxElement": "SPDXRef-binary" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-0" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-1" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-2" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-3" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-4" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-5" + }, + { + "spdxElementId": "SPDXRef-binary", + "relationshipType": "GENERATED_FROM", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-0", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-1", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-2", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-2", + "relationshipType": "DEPENDENCY_MANIFEST_OF", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-3", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-4", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-5", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + } + ], + "packages": [ + { + "name": "vcpkg-cmake", + "SPDXID": "SPDXRef-port", + "versionInfo": "2022-10-30", + "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/vcpkg-cmake", + "licenseConcluded": "MIT", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "comment": "This is the port (recipe) consumed by vcpkg." + }, + { + "name": "vcpkg-cmake:x64-windows", + "SPDXID": "SPDXRef-binary", + "versionInfo": "071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2", + "downloadLocation": "NONE", + "licenseConcluded": "MIT", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "comment": "This is a binary package built by vcpkg." + } + ], + "files": [ + { + "fileName": "./portfile.cmake", + "SPDXID": "SPDXRef-file-0", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "a711531b7f13b7da16fa1f25d7c5737a423d4a126465dc9e6689a0f043fcc1aa" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg-port-config.cmake", + "SPDXID": "SPDXRef-file-1", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "f0a30f77c8f5e3ac40436fe2518a61ad067f2955c7ef3be6d6a0ca4b81cd2a45" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg.json", + "SPDXID": "SPDXRef-file-2", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "0cb2343f8550250b0ce0c48e9d9b5f178b73de14dcc18ad5e1c0a9b390ff4046" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg_cmake_build.cmake", + "SPDXID": "SPDXRef-file-3", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "6d1c27080fe3e768b5e7b968d6a28a37db154ebcb214297de25f10b6713511e1" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg_cmake_configure.cmake", + "SPDXID": "SPDXRef-file-4", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "7deaf313e87fb697724d0b0297dae9570ea62aad90d713a2ad000f765888cbdf" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg_cmake_install.cmake", + "SPDXID": "SPDXRef-file-5", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "3ae7886dc8434fac6f1e61190cc355fdec5fbd4f60758e2de20423cf49c91369" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + } + ] +} diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_abi_info.txt new file mode 100644 index 000000000..44a72672a --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_abi_info.txt @@ -0,0 +1,19 @@ +cmake 3.24.0 +features core +portfile.cmake a711531b7f13b7da16fa1f25d7c5737a423d4a126465dc9e6689a0f043fcc1aa +ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 +post_build_checks 2 +powershell 7.3.0 +triplet x64-windows +triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 +vcpkg-port-config.cmake f0a30f77c8f5e3ac40436fe2518a61ad067f2955c7ef3be6d6a0ca4b81cd2a45 +vcpkg.json 0cb2343f8550250b0ce0c48e9d9b5f178b73de14dcc18ad5e1c0a9b390ff4046 +vcpkg_add_to_path 5f5ae75cf37b2a58d1a8561ca96496b64cd91ec9a0afab0b976c3e5d59030bfe +vcpkg_cmake_build.cmake 6d1c27080fe3e768b5e7b968d6a28a37db154ebcb214297de25f10b6713511e1 +vcpkg_cmake_configure.cmake 7deaf313e87fb697724d0b0297dae9570ea62aad90d713a2ad000f765888cbdf +vcpkg_cmake_install.cmake 3ae7886dc8434fac6f1e61190cc355fdec5fbd4f60758e2de20423cf49c91369 +vcpkg_configure_cmake d502a617f32d9da6020e15f2ecd06237125fb082b11c16127bd925cd820e3d3a +vcpkg_execute_build_process 1b4fa8be39276dbf7d6d343e1dfc9aa25c0fc4cd35348d5e4c2cca174eb1de59 +vcpkg_execute_required_process 975eab651b1f156e5550defb3abad898ff8159b57a0e0562d3ac3c959043476d +vcpkg_find_acquire_program 6ec553a41c83b89035d8649f06162e79bc0e6e6f49d8a6d05fdea67ccfdb6541 +vcpkg_list f5de3ebcbc40a4db90622ade9aca918e2cf404dc0d91342fcde457d730e6fa29 diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_build.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_build.cmake new file mode 100644 index 000000000..47933b3fe --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_build.cmake @@ -0,0 +1,91 @@ +include_guard(GLOBAL) + +function(vcpkg_cmake_build) + cmake_parse_arguments(PARSE_ARGV 0 "arg" "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "TARGET;LOGFILE_BASE" "") + + if(DEFINED arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_cmake_build was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") + endif() + if(NOT DEFINED arg_LOGFILE_BASE) + set(arg_LOGFILE_BASE "build") + endif() + vcpkg_list(SET build_param) + vcpkg_list(SET parallel_param) + vcpkg_list(SET no_parallel_param) + + if("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "Ninja") + vcpkg_list(SET build_param "-v") # verbose output + vcpkg_list(SET parallel_param "-j${VCPKG_CONCURRENCY}") + vcpkg_list(SET no_parallel_param "-j1") + elseif("${Z_VCPKG_CMAKE_GENERATOR}" MATCHES "^Visual Studio") + vcpkg_list(SET build_param + "/p:VCPkgLocalAppDataDisabled=true" + "/p:UseIntelMKL=No" + ) + vcpkg_list(SET parallel_param "/m") + elseif("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "NMake Makefiles") + # No options are currently added for nmake builds + elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Unix Makefiles") + vcpkg_list(SET build_param "VERBOSE=1") + vcpkg_list(SET parallel_param "-j${VCPKG_CONCURRENCY}") + vcpkg_list(SET no_parallel_param "") + elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Xcode") + vcpkg_list(SET parallel_param -jobs "${VCPKG_CONCURRENCY}") + vcpkg_list(SET no_parallel_param -jobs 1) + else() + message(WARNING "Unrecognized GENERATOR setting from vcpkg_cmake_configure().") + endif() + + vcpkg_list(SET target_param) + if(arg_TARGET) + vcpkg_list(SET target_param "--target" "${arg_TARGET}") + endif() + + foreach(build_type IN ITEMS debug release) + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "${build_type}") + if("${build_type}" STREQUAL "debug") + set(short_build_type "dbg") + set(config "Debug") + else() + set(short_build_type "rel") + set(config "Release") + endif() + + message(STATUS "Building ${TARGET_TRIPLET}-${short_build_type}") + + if(arg_ADD_BIN_TO_PATH) + vcpkg_backup_env_variables(VARS PATH) + if("${build_type}" STREQUAL "debug") + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") + else() + vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") + endif() + endif() + + if(arg_DISABLE_PARALLEL) + vcpkg_execute_build_process( + COMMAND + "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} + -- ${build_param} ${no_parallel_param} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_build_type}" + LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_build_type}" + ) + else() + vcpkg_execute_build_process( + COMMAND + "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} + -- ${build_param} ${parallel_param} + NO_PARALLEL_COMMAND + "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} + -- ${build_param} ${no_parallel_param} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_build_type}" + LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_build_type}" + ) + endif() + + if(arg_ADD_BIN_TO_PATH) + vcpkg_restore_env_variables(VARS PATH) + endif() + endif() + endforeach() +endfunction() diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_configure.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_configure.cmake new file mode 100644 index 000000000..832bbf700 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_configure.cmake @@ -0,0 +1,320 @@ +include_guard(GLOBAL) + +macro(z_vcpkg_cmake_configure_both_set_or_unset var1 var2) + if(DEFINED ${var1} AND NOT DEFINED ${var2}) + message(FATAL_ERROR "If ${var1} is set, then ${var2} must be set.") + elseif(NOT DEFINED ${var1} AND DEFINED ${var2}) + message(FATAL_ERROR "If ${var2} is set, then ${var1} must be set.") + endif() +endmacro() + +function(vcpkg_cmake_configure) + cmake_parse_arguments(PARSE_ARGV 0 "arg" + "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;WINDOWS_USE_MSBUILD;NO_CHARSET_FLAG;Z_CMAKE_GET_VARS_USAGE" + "SOURCE_PATH;GENERATOR;LOGFILE_BASE" + "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;MAYBE_UNUSED_VARIABLES" + ) + + if(NOT arg_Z_CMAKE_GET_VARS_USAGE AND DEFINED CACHE{Z_VCPKG_CMAKE_GENERATOR}) + message(WARNING "${CMAKE_CURRENT_FUNCTION} already called; this function should only be called once.") + endif() + if(arg_PREFER_NINJA) + message(WARNING "PREFER_NINJA has been deprecated in ${CMAKE_CURRENT_FUNCTION}. Please remove it from the portfile!") + endif() + + if(DEFINED arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") + endif() + + if(NOT DEFINED arg_SOURCE_PATH) + message(FATAL_ERROR "SOURCE_PATH must be set") + endif() + if(NOT DEFINED arg_LOGFILE_BASE) + set(arg_LOGFILE_BASE "config-${TARGET_TRIPLET}") + endif() + + set(manually_specified_variables "") + + if(arg_Z_CMAKE_GET_VARS_USAGE) + set(configuring_message "Getting CMake variables for ${TARGET_TRIPLET}") + else() + set(configuring_message "Configuring ${TARGET_TRIPLET}") + + foreach(option IN LISTS arg_OPTIONS arg_OPTIONS_RELEASE arg_OPTIONS_DEBUG) + if("${option}" MATCHES "^-D([^:=]*)[:=]") + vcpkg_list(APPEND manually_specified_variables "${CMAKE_MATCH_1}") + endif() + endforeach() + vcpkg_list(REMOVE_DUPLICATES manually_specified_variables) + foreach(maybe_unused_var IN LISTS arg_MAYBE_UNUSED_VARIABLES) + vcpkg_list(REMOVE_ITEM manually_specified_variables "${maybe_unused_var}") + endforeach() + debug_message("manually specified variables: ${manually_specified_variables}") + endif() + + if(CMAKE_HOST_WIN32) + if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) + set(host_architecture "$ENV{PROCESSOR_ARCHITEW6432}") + else() + set(host_architecture "$ENV{PROCESSOR_ARCHITECTURE}") + endif() + endif() + + set(ninja_host ON) # Ninja availability + if(host_architecture STREQUAL "x86" OR DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES}) + # Prebuilt ninja binaries are only provided for x64 hosts + find_program(NINJA NAMES ninja ninja-build) + if(NOT NINJA) + set(ninja_host OFF) + set(arg_DISABLE_PARALLEL_CONFIGURE ON) + set(arg_WINDOWS_USE_MSBUILD ON) + endif() + endif() + + set(generator "") + set(architecture_options "") + if(arg_WINDOWS_USE_MSBUILD AND VCPKG_HOST_IS_WINDOWS AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + z_vcpkg_get_visual_studio_generator(OUT_GENERATOR generator OUT_ARCH arch) + vcpkg_list(APPEND architecture_options "-A${arch}") + if(DEFINED VCPKG_PLATFORM_TOOLSET) + vcpkg_list(APPEND arg_OPTIONS "-T${VCPKG_PLATFORM_TOOLSET}") + endif() + if(NOT generator) + message(FATAL_ERROR "Unable to determine appropriate Visual Studio generator for triplet ${TARGET_TRIPLET}: + ENV{VisualStudioVersion} : $ENV{VisualStudioVersion} + VCPKG_TARGET_ARCHITECTURE: ${VCPKG_TARGET_ARCHITECTURE}") + endif() + elseif(DEFINED arg_GENERATOR) + set(generator "${arg_GENERATOR}") + elseif(ninja_host) + set(generator "Ninja") + elseif(NOT VCPKG_HOST_IS_WINDOWS) + set(generator "Unix Makefiles") + endif() + + if(NOT generator) + if(NOT VCPKG_CMAKE_SYSTEM_NAME) + set(VCPKG_CMAKE_SYSTEM_NAME "Windows") + endif() + message(FATAL_ERROR "Unable to determine appropriate generator for: " + "${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}") + endif() + + if(generator STREQUAL "Ninja") + vcpkg_find_acquire_program(NINJA) + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") + # If we use Ninja, it must be on PATH for CMake's ExternalProject, + # cf. https://gitlab.kitware.com/cmake/cmake/-/issues/23355. + get_filename_component(ninja_path "${NINJA}" DIRECTORY) + vcpkg_add_to_path("${ninja_path}") + endif() + + set(build_dir_release "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") + set(build_dir_debug "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") + file(REMOVE_RECURSE + "${build_dir_release}" + "${build_dir_debug}") + file(MAKE_DIRECTORY "${build_dir_release}") + if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(MAKE_DIRECTORY "${build_dir_debug}") + endif() + + if(DEFINED VCPKG_CMAKE_SYSTEM_NAME) + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") + if(VCPKG_TARGET_IS_UWP AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) + set(VCPKG_CMAKE_SYSTEM_VERSION 10.0) + elseif(VCPKG_TARGET_IS_ANDROID AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) + set(VCPKG_CMAKE_SYSTEM_VERSION 21) + endif() + endif() + + if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION) + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") + endif() + + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=ON") + elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=OFF") + else() + message(FATAL_ERROR + "Invalid setting for VCPKG_LIBRARY_LINKAGE: \"${VCPKG_LIBRARY_LINKAGE}\". " + "It must be \"static\" or \"dynamic\"") + endif() + + z_vcpkg_cmake_configure_both_set_or_unset(VCPKG_CXX_FLAGS_DEBUG VCPKG_C_FLAGS_DEBUG) + z_vcpkg_cmake_configure_both_set_or_unset(VCPKG_CXX_FLAGS_RELEASE VCPKG_C_FLAGS_RELEASE) + z_vcpkg_cmake_configure_both_set_or_unset(VCPKG_CXX_FLAGS VCPKG_C_FLAGS) + + set(VCPKG_SET_CHARSET_FLAG ON) + if(arg_NO_CHARSET_FLAG) + set(VCPKG_SET_CHARSET_FLAG OFF) + endif() + + if(NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + z_vcpkg_select_default_vcpkg_chainload_toolchain() + endif() + + list(JOIN VCPKG_TARGET_ARCHITECTURE "\;" target_architecture_string) + vcpkg_list(APPEND arg_OPTIONS + "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" + "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" + "-DVCPKG_SET_CHARSET_FLAG=${VCPKG_SET_CHARSET_FLAG}" + "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}" + "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" + "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" + "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" + "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DVCPKG_APPLOCAL_DEPS=OFF" + "-DCMAKE_TOOLCHAIN_FILE=${SCRIPTS}/buildsystems/vcpkg.cmake" + "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" + "-DVCPKG_CXX_FLAGS=${VCPKG_CXX_FLAGS}" + "-DVCPKG_CXX_FLAGS_RELEASE=${VCPKG_CXX_FLAGS_RELEASE}" + "-DVCPKG_CXX_FLAGS_DEBUG=${VCPKG_CXX_FLAGS_DEBUG}" + "-DVCPKG_C_FLAGS=${VCPKG_C_FLAGS}" + "-DVCPKG_C_FLAGS_RELEASE=${VCPKG_C_FLAGS_RELEASE}" + "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" + "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" + "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" + "-DVCPKG_LINKER_FLAGS_RELEASE=${VCPKG_LINKER_FLAGS_RELEASE}" + "-DVCPKG_LINKER_FLAGS_DEBUG=${VCPKG_LINKER_FLAGS_DEBUG}" + "-DVCPKG_TARGET_ARCHITECTURE=${target_architecture_string}" + "-DCMAKE_INSTALL_LIBDIR:STRING=lib" + "-DCMAKE_INSTALL_BINDIR:STRING=bin" + "-D_VCPKG_ROOT_DIR=${VCPKG_ROOT_DIR}" + "-D_VCPKG_INSTALLED_DIR=${_VCPKG_INSTALLED_DIR}" + "-DVCPKG_MANIFEST_INSTALL=OFF" + "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" + ) + + # Sets configuration variables for macOS builds + foreach(config_var IN ITEMS INSTALL_NAME_DIR OSX_DEPLOYMENT_TARGET OSX_SYSROOT OSX_ARCHITECTURES) + if(DEFINED VCPKG_${config_var}) + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_${config_var}=${VCPKG_${config_var}}") + endif() + endforeach() + + # Allow overrides / additional configuration variables from triplets + if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS) + vcpkg_list(APPEND arg_OPTIONS ${VCPKG_CMAKE_CONFIGURE_OPTIONS}) + endif() + if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE) + vcpkg_list(APPEND arg_OPTIONS_RELEASE ${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE}) + endif() + if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG) + vcpkg_list(APPEND arg_OPTIONS_DEBUG ${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG}) + endif() + + vcpkg_list(SET rel_command + "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" + -G "${generator}" + ${architecture_options} + "-DCMAKE_BUILD_TYPE=Release" + "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}" + ${arg_OPTIONS} ${arg_OPTIONS_RELEASE}) + vcpkg_list(SET dbg_command + "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" + -G "${generator}" + ${architecture_options} + "-DCMAKE_BUILD_TYPE=Debug" + "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug" + ${arg_OPTIONS} ${arg_OPTIONS_DEBUG}) + + if(NOT arg_DISABLE_PARALLEL_CONFIGURE) + vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_DISABLE_SOURCE_CHANGES=ON") + + vcpkg_find_acquire_program(NINJA) + + #parallelize the configure step + set(ninja_configure_contents + "rule CreateProcess\n command = \$process\n\n" + ) + + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") + z_vcpkg_configure_cmake_build_cmakecache(ninja_configure_contents ".." "rel") + endif() + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") + z_vcpkg_configure_cmake_build_cmakecache(ninja_configure_contents "../../${TARGET_TRIPLET}-dbg" "dbg") + endif() + + file(MAKE_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure") + file(WRITE + "${build_dir_release}/vcpkg-parallel-configure/build.ninja" + "${ninja_configure_contents}") + + message(STATUS "${configuring_message}") + vcpkg_execute_required_process( + COMMAND "${NINJA}" -v + WORKING_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure" + LOGNAME "${arg_LOGFILE_BASE}" + SAVE_LOG_FILES ../../${TARGET_TRIPLET}-dbg/CMakeCache.txt ../CMakeCache.txt + ) + + vcpkg_list(APPEND config_logs + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-out.log" + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-err.log") + else() + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") + message(STATUS "${configuring_message}-dbg") + vcpkg_execute_required_process( + COMMAND ${dbg_command} + WORKING_DIRECTORY "${build_dir_debug}" + LOGNAME "${arg_LOGFILE_BASE}-dbg" + SAVE_LOG_FILES CMakeCache.txt + ) + vcpkg_list(APPEND config_logs + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-out.log" + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-err.log") + endif() + + if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") + message(STATUS "${configuring_message}-rel") + vcpkg_execute_required_process( + COMMAND ${rel_command} + WORKING_DIRECTORY "${build_dir_release}" + LOGNAME "${arg_LOGFILE_BASE}-rel" + SAVE_LOG_FILES CMakeCache.txt + ) + vcpkg_list(APPEND config_logs + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-out.log" + "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-err.log") + endif() + endif() + + set(all_unused_variables) + foreach(config_log IN LISTS config_logs) + if(NOT EXISTS "${config_log}") + continue() + endif() + file(READ "${config_log}" log_contents) + debug_message("Reading configure log ${config_log}...") + if(NOT log_contents MATCHES "Manually-specified variables were not used by the project:\n\n(( [^\n]*\n)*)") + continue() + endif() + string(STRIP "${CMAKE_MATCH_1}" unused_variables) # remove leading ` ` and trailing `\n` + string(REPLACE "\n " ";" unused_variables "${unused_variables}") + debug_message("unused variables: ${unused_variables}") + foreach(unused_variable IN LISTS unused_variables) + if(unused_variable IN_LIST manually_specified_variables) + debug_message("manually specified unused variable: ${unused_variable}") + vcpkg_list(APPEND all_unused_variables "${unused_variable}") + else() + debug_message("unused variable (not manually specified): ${unused_variable}") + endif() + endforeach() + endforeach() + + if(DEFINED all_unused_variables) + vcpkg_list(REMOVE_DUPLICATES all_unused_variables) + vcpkg_list(JOIN all_unused_variables "\n " all_unused_variables) + message(WARNING "The following variables are not used in CMakeLists.txt: + ${all_unused_variables} +Please recheck them and remove the unnecessary options from the `vcpkg_cmake_configure` call. +If these options should still be passed for whatever reason, please use the `MAYBE_UNUSED_VARIABLES` argument.") + endif() + + if(NOT arg_Z_CMAKE_GET_VARS_USAGE) + set(Z_VCPKG_CMAKE_GENERATOR "${generator}" CACHE INTERNAL "The generator which was used to configure CMake.") + endif() +endfunction() diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_install.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_install.cmake new file mode 100644 index 000000000..2bd8b4ea7 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_install.cmake @@ -0,0 +1,21 @@ +include_guard(GLOBAL) + +function(vcpkg_cmake_install) + cmake_parse_arguments(PARSE_ARGV 0 "arg" "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "" "") + if(DEFINED arg_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "vcpkg_cmake_install was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") + endif() + + set(args) + foreach(arg IN ITEMS DISABLE_PARALLEL ADD_BIN_TO_PATH) + if(arg_${arg}) + list(APPEND args "${arg}") + endif() + endforeach() + + vcpkg_cmake_build( + ${args} + LOGFILE_BASE install + TARGET install + ) +endfunction() diff --git a/NorthstarDLL/include/libzip/share/zlib/copyright b/NorthstarDLL/include/libzip/share/zlib/copyright new file mode 100644 index 000000000..ab8ee6f71 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/zlib/copyright @@ -0,0 +1,22 @@ +Copyright notice: + + (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu diff --git a/NorthstarDLL/include/libzip/share/zlib/usage b/NorthstarDLL/include/libzip/share/zlib/usage new file mode 100644 index 000000000..0dfed7493 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/zlib/usage @@ -0,0 +1,4 @@ +The package zlib is compatible with built-in CMake targets: + + find_package(ZLIB REQUIRED) + target_link_libraries(main PRIVATE ZLIB::ZLIB) diff --git a/NorthstarDLL/include/libzip/share/zlib/vcpkg-cmake-wrapper.cmake b/NorthstarDLL/include/libzip/share/zlib/vcpkg-cmake-wrapper.cmake new file mode 100644 index 000000000..868a41851 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/zlib/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,12 @@ +find_path(ZLIB_INCLUDE_DIR NAMES zlib.h PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" NO_DEFAULT_PATH) +find_library(ZLIB_LIBRARY_RELEASE NAMES zlib z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) +find_library(ZLIB_LIBRARY_DEBUG NAMES zlibd z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) +if(NOT ZLIB_INCLUDE_DIR OR NOT (ZLIB_LIBRARY_RELEASE OR ZLIB_LIBRARY_DEBUG)) + message(FATAL_ERROR "Broken installation of vcpkg port zlib") +endif() +if(CMAKE_VERSION VERSION_LESS 3.4) + include(SelectLibraryConfigurations) + select_library_configurations(ZLIB) + unset(ZLIB_FOUND) +endif() +_find_package(${ARGS}) diff --git a/NorthstarDLL/include/libzip/share/zlib/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/zlib/vcpkg.spdx.json new file mode 100644 index 000000000..5e0d186d2 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/zlib/vcpkg.spdx.json @@ -0,0 +1,247 @@ +{ + "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", + "spdxVersion": "SPDX-2.2", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "documentNamespace": "https://spdx.org/spdxdocs/zlib-x64-windows-1.2.13-2f3e3fb0-98ea-4a59-8feb-9eccea5e0572", + "name": "zlib:x64-windows@1.2.13 cfba80992a665d41aa217b6bd51c1720ddab0b5bcdc338feae38235d27cdc83c", + "creationInfo": { + "creators": [ + "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" + ], + "created": "2022-11-21T10:26:42Z" + }, + "relationships": [ + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "GENERATES", + "relatedSpdxElement": "SPDXRef-binary" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-0" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-1" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-2" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-3" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-4" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-5" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-6" + }, + { + "spdxElementId": "SPDXRef-port", + "relationshipType": "CONTAINS", + "relatedSpdxElement": "SPDXRef-file-7" + }, + { + "spdxElementId": "SPDXRef-binary", + "relationshipType": "GENERATED_FROM", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-0", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-1", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-2", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-3", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-4", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-5", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-6", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-7", + "relationshipType": "CONTAINED_BY", + "relatedSpdxElement": "SPDXRef-port" + }, + { + "spdxElementId": "SPDXRef-file-7", + "relationshipType": "DEPENDENCY_MANIFEST_OF", + "relatedSpdxElement": "SPDXRef-port" + } + ], + "packages": [ + { + "name": "zlib", + "SPDXID": "SPDXRef-port", + "versionInfo": "1.2.13", + "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/zlib", + "homepage": "https://www.zlib.net/", + "licenseConcluded": "Zlib", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "description": "A compression library", + "comment": "This is the port (recipe) consumed by vcpkg." + }, + { + "name": "zlib:x64-windows", + "SPDXID": "SPDXRef-binary", + "versionInfo": "cfba80992a665d41aa217b6bd51c1720ddab0b5bcdc338feae38235d27cdc83c", + "downloadLocation": "NONE", + "licenseConcluded": "Zlib", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "comment": "This is a binary package built by vcpkg." + }, + { + "SPDXID": "SPDXRef-resource-1", + "name": "madler/zlib", + "downloadLocation": "git+https://github.com/madler/zlib@v1.2.13", + "licenseConcluded": "NOASSERTION", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "checksums": [ + { + "algorithm": "SHA512", + "checksumValue": "44b834fbfb50cca229209b8dbe1f96b258f19a49f5df23b80970b716371d856a4adf525edb4c6e0e645b180ea949cb90f5365a1d896160f297f56794dd888659" + } + ] + } + ], + "files": [ + { + "fileName": "./0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch", + "SPDXID": "SPDXRef-file-0", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "750b9542cb55e6328cca01d3ca997f1373b9530afa95e04213168676936e7bfa" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./0002-skip-building-examples.patch", + "SPDXID": "SPDXRef-file-1", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "835ddecfed752e0f49be9b0f8ff7ba76541cb0a150044327316e22ca84f8d0c2" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./0003-build-static-or-shared-not-both.patch", + "SPDXID": "SPDXRef-file-2", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "d6026271dcb3d8fc74b41e235620ae31576a798e77aa411c3af8cd9e948c02b1" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./0004-android-and-mingw-fixes.patch", + "SPDXID": "SPDXRef-file-3", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "37a43eddbcb1b7dde49e7659ae895dfd0ff1df66666c1371ba7d5bfc49d8b438" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./portfile.cmake", + "SPDXID": "SPDXRef-file-4", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "ac63047b644fa758860dd7ba48ff9a13b058c6f240b8e8d675b8fbba035976be" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./usage", + "SPDXID": "SPDXRef-file-5", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "be22662327df993eebc437495add75acb365ab18d37c7e5de735d4ea4f5d3083" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg-cmake-wrapper.cmake", + "SPDXID": "SPDXRef-file-6", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "5d49ef2ee6448479c2aad0e5f732e2676eaba0411860f9bebabe6002d66f57d1" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + }, + { + "fileName": "./vcpkg.json", + "SPDXID": "SPDXRef-file-7", + "checksums": [ + { + "algorithm": "SHA256", + "checksumValue": "bc94e2540efabe36130a806381a001c57194e7de67454ab7ff1e30aa15e6ce23" + } + ], + "licenseConcluded": "NOASSERTION", + "copyrightText": "NOASSERTION" + } + ] +} diff --git a/NorthstarDLL/include/libzip/share/zlib/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/zlib/vcpkg_abi_info.txt new file mode 100644 index 000000000..7716f77f8 --- /dev/null +++ b/NorthstarDLL/include/libzip/share/zlib/vcpkg_abi_info.txt @@ -0,0 +1,21 @@ +0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch 750b9542cb55e6328cca01d3ca997f1373b9530afa95e04213168676936e7bfa +0002-skip-building-examples.patch 835ddecfed752e0f49be9b0f8ff7ba76541cb0a150044327316e22ca84f8d0c2 +0003-build-static-or-shared-not-both.patch d6026271dcb3d8fc74b41e235620ae31576a798e77aa411c3af8cd9e948c02b1 +0004-android-and-mingw-fixes.patch 37a43eddbcb1b7dde49e7659ae895dfd0ff1df66666c1371ba7d5bfc49d8b438 +cmake 3.24.0 +features core +portfile.cmake ac63047b644fa758860dd7ba48ff9a13b058c6f240b8e8d675b8fbba035976be +ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 +post_build_checks 2 +powershell 7.3.0 +triplet x64-windows +triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 +usage be22662327df993eebc437495add75acb365ab18d37c7e5de735d4ea4f5d3083 +vcpkg-cmake 071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2 +vcpkg-cmake-wrapper.cmake 5d49ef2ee6448479c2aad0e5f732e2676eaba0411860f9bebabe6002d66f57d1 +vcpkg.json bc94e2540efabe36130a806381a001c57194e7de67454ab7ff1e30aa15e6ce23 +vcpkg_copy_pdbs d57e4f196c82dc562a9968c6155073094513c31e2de475694143d3aa47954b1c +vcpkg_fixup_pkgconfig 433d0d235b4e9f6c7bb8744a2f06a9f534b355da67d0d85b7c2daf15c8c77671 +vcpkg_from_git 42a2f33208e157d5332b7ce93a28fc3948d4c0be78cacc8013a5d6ce06eaede1 +vcpkg_from_github b743742296a114ea1b18ae99672e02f142c4eb2bef7f57d36c038bedbfb0502f +vcpkg_replace_string d43c8699ce27e25d47367c970d1c546f6bc36b6df8fb0be0c3986eb5830bd4f1 diff --git a/NorthstarDLL/include/libzip/tools/bzip2/bzip2.exe b/NorthstarDLL/include/libzip/tools/bzip2/bzip2.exe new file mode 100644 index 0000000000000000000000000000000000000000..5dbb7889e824a84a0dc37bf878503587fe82d4c0 GIT binary patch literal 92672 zcmeEveSB2K)&FjG7XnGR0kVo1B-+&m7ikpKz$Tg-?!sN%Kq@Gxh|wsbwMubUqlU0? zHzn)jYO1ugRa<=YX|388tMVq*-30Q&Yj{ymL;+vAF`@w!!i(JB_srZ)c0=s1&+}9N z`tc#TbLQooIrDPn%$YNjlI!bD7L&4>G+rVAHuP z&E8Gt&X{+{y*cw2+;jVan}42De)HXT-{Z@<<+hv!{=0MTxI0IgHa+L(_uP8hn2d~p z4g+;TAbd~7zJC?Oe}3^hU%@=UUBCad@FD&kUQo%u`wQ>l-;W9x@bAZk6#vo_pB6rd zZ^gb(3ogU=$nQTYoX@|X6h46O)pwN7BiwOLO5G;Yt-tJNy8h~i%HwgJrt?f`DTB^6 z4K$lfvqfw`LO7F$ix3jw6qBi+Nbdfc+K`II>vW``9m}fYg^aRB!JZEl7icMDGM$`h zHoZ@QWoFZBL};nmG_OBJ82=(>lMli9Q_Q9r@wh&|c^*x_viK@_$*BKUNCaKmb`3lSz6reWY%GQzWLTdb8f7rOGSm+mY&J&1#Kab(WWH@H#iCTKa{m-XKfMtpjS!9#>oC z0Z(<;K;)EyEkNL|b>xQ z8jSKE4MuHhd8=-J7TI~;097a4Pi1eb&UMmA0!`BLfwk$Gs&=(G)apOfG1|i>rFz&A zMyWm8j8IHr!I=AD#U626>xm1MQE1F(EMJ8 z)>eaS^W~dvXpH@(%VgRZbDo3WJ^#>`xq-rOs?ngnb5_wL((Rp8Vb-E*_CZ4t3a-s< zzX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oaI+DpeKIo-(V>jFu zt_#58m=rD-pGC}cxPd)qoZySmsj-?U7*Da! zA<}^sv;!IRf^1j{?a&FY!@Cd#4{=O*N^Z%t)TA!=WmcZZS87v-x+JMbeHzd^jp&0u RX-pHE(v0BwpVnjrz5pn|?N9&! literal 0 HcmV?d00001 diff --git a/NorthstarDLL/include/libzip/tools/bzip2/bzip2recover.exe b/NorthstarDLL/include/libzip/tools/bzip2/bzip2recover.exe new file mode 100644 index 0000000000000000000000000000000000000000..ad286ffcf4447485c6fb00b77319b3892a05afcc GIT binary patch literal 19456 zcmeHv4Ompw*8d)0a1?0J9K*~!>Y#W{L@`4V8wB(qgA$^dU&9E4Oae2`hl*x_Bj$LT zqMNB@A7*7%Sk_g;uL4n!#3J>UUlrF%M=_(1i>BrLf9sqxfYt4J|Ih#bzR&wS_s+fR z{MKH3?Y-Atd+o2ovGf_`ERZo41oHV9s|32(iq;FQf z+0I#QmU%W~A(vw;DzZ4ZxhBr$EaJ>XT=L{8T%je`6de}UMJreR#y_7we|gQ1+x>L@ zQug+g-(A^pPQ>qb zdMtahl?%256_=_djWWU^w2N^_try%I?;~2}1w&fZfM#lcCK?dq% zJwV9l_|u{3Xi1G#t%+bP1G%?=Mt0PK5@S`-R!LFpBl;?~nfyCFU9`<^qX80q!r)`- z3;#!YrUDBT$wv&n67?qjPH)`JlK-Uq9^gI7&QlnxX^?-qDZJ|vS5h3lh!;*eCkTn5 zuB)nL5kjgePu&OOa;i#}hA(p7)~x1*!@TPNHEvtX{ zRv}5{t3P(t)ueEzg^HzX#LBzNmG|&zhM_K39CP-q6k~>3sBtH$s;_oJsk)@lPUyQ- z(i?qKThwS@V&8up4;WnwbsN!ASxud18 zyxXCTxSzbq3qPxOUVNY0E!U}cek6Q;tXY^G>iSvb?62NA84kS7r%58K;lQzQ;G=0+ zh!s$GeWhp)6DFvDfmIRQuRdQ2_0FN?^gl~3-618bEVByfC)lur{) zl?sP=k0ux6bH3%Cg@1JN?y^QBDNq zkh^@ES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0S0nxficGA07id$;82DA=5ec)aV>W%ywq;CU8Bkvs`)jJ4zv{vE3$>JcZr*fd@ zAg8rx8j!wdr17H5a6EWA|1AO@N1E0t7x);+Qb80yMv?=+gZz8oXwYYl@ASZLdJqiu3~H(_EwZe;G1b zm*YXS9`^upkZ%CeTwMbGGswq)&wy@Er0)g}2GxS7{u1Qf3+j)w68WLPkARV&Pe3#_ zF-B688c+emeDF>iHz%I+#+M8jE7`A@qdX&W^+gLj{AK6uScEhVRVNd{jm?`G9s9Z zAKnv7KQT%2f9GF#IARG@fcNMdfq`8mJ{(A&#gjY(_$lZi@J+zTZdjMWcYL=_@8UP! zjyR%vfcrrQz&8R1;h%j`Ju$$wpj^@c-T+ZO^xvLX4sw8B0jva(KH=)#INyMO4EQ2Q zEDIcSC-x4=310{O0=@#+yAMV<0c`;%fg-?X1K$F1;OXykd7M;#K5#LJ>Lh$p=GOq} zzyA>heZqbq($NBE%X~KQbr9KE0lcTb#K!>}LHQ_4_>(Lr?5&k_IN%JKp9QposD1~K zi^N`nvROb2h~#U4U*aDA9OPc$sDYAP4}1+&0r?i-*D_DY;WAHh!iGWcC3t+(!#05q zfyZ|};@|ul!PDO=>F*HP;0b>Ltpfj_-@lIsg2b*W#J_z1(L~8)LNFO@(vu?at!Df+BlDKc}r|v^^)^RA{shDKzKUEOtwtV+h{C zjyBp0qZbbAhtIEy%z5~VXqw4p$BX=ge)wFe-`KD&95=>cbJ`uLMR}J0Vr{WfIh3@U z@D~EJqgbqm!*7iIQI{ztlxAWb2rrZJkE(F+=_S9Gj7t zk(ivEI%&f6=`!>GlBPk$|Cwr2_@;u}6&owIRBWrLtPq3eKac Date: Fri, 2 Dec 2022 22:03:35 +0100 Subject: [PATCH 09/78] Revert "build: add libzip library" This reverts commit 86c3ba2251ae1c5e90f104fe39f22bc4a04fca5f. --- NorthstarDLL/include/libzip/include/bzlib.h | 276 --- NorthstarDLL/include/libzip/include/zconf.h | 557 ----- NorthstarDLL/include/libzip/include/zip.h | 487 ----- NorthstarDLL/include/libzip/include/zipconf.h | 51 - NorthstarDLL/include/libzip/include/zlib.h | 1935 ----------------- NorthstarDLL/include/libzip/lib/bz2.lib | Bin 6224 -> 0 bytes .../include/libzip/lib/pkgconfig/bzip2.pc | 12 - .../include/libzip/lib/pkgconfig/libzip.pc | 15 - .../include/libzip/lib/pkgconfig/zlib.pc | 14 - NorthstarDLL/include/libzip/lib/zip.lib | Bin 27916 -> 0 bytes NorthstarDLL/include/libzip/lib/zlib.lib | Bin 16746 -> 0 bytes .../include/libzip/share/bzip2/copyright | 42 - NorthstarDLL/include/libzip/share/bzip2/usage | 4 - .../libzip/share/bzip2/vcpkg.spdx.json | 204 -- .../libzip/share/bzip2/vcpkg_abi_info.txt | 21 - .../include/libzip/share/libzip/copyright | 31 - .../share/libzip/libzip-config-version.cmake | 48 - .../libzip/share/libzip/libzip-config.cmake | 47 - .../share/libzip/libzip-targets-debug.cmake | 19 - .../share/libzip/libzip-targets-release.cmake | 19 - .../libzip/share/libzip/libzip-targets.cmake | 101 - .../libzip/share/libzip/vcpkg.spdx.json | 137 -- .../libzip/share/libzip/vcpkg_abi_info.txt | 19 - .../libzip/share/vcpkg-cmake-config/copyright | 23 - .../vcpkg-port-config.cmake | 1 - .../share/vcpkg-cmake-config/vcpkg.spdx.json | 165 -- .../vcpkg-cmake-config/vcpkg_abi_info.txt | 13 - .../vcpkg_cmake_config_fixup.cmake | 258 --- .../libzip/share/vcpkg-cmake/copyright | 23 - .../share/vcpkg-cmake/vcpkg-port-config.cmake | 3 - .../libzip/share/vcpkg-cmake/vcpkg.spdx.json | 187 -- .../share/vcpkg-cmake/vcpkg_abi_info.txt | 19 - .../share/vcpkg-cmake/vcpkg_cmake_build.cmake | 91 - .../vcpkg-cmake/vcpkg_cmake_configure.cmake | 320 --- .../vcpkg-cmake/vcpkg_cmake_install.cmake | 21 - .../include/libzip/share/zlib/copyright | 22 - NorthstarDLL/include/libzip/share/zlib/usage | 4 - .../share/zlib/vcpkg-cmake-wrapper.cmake | 12 - .../include/libzip/share/zlib/vcpkg.spdx.json | 247 --- .../libzip/share/zlib/vcpkg_abi_info.txt | 21 - .../include/libzip/tools/bzip2/bzip2.exe | Bin 92672 -> 0 bytes .../libzip/tools/bzip2/bzip2recover.exe | Bin 19456 -> 0 bytes NorthstarDLL/verifiedmods.cpp | 11 - 43 files changed, 5480 deletions(-) delete mode 100644 NorthstarDLL/include/libzip/include/bzlib.h delete mode 100644 NorthstarDLL/include/libzip/include/zconf.h delete mode 100644 NorthstarDLL/include/libzip/include/zip.h delete mode 100644 NorthstarDLL/include/libzip/include/zipconf.h delete mode 100644 NorthstarDLL/include/libzip/include/zlib.h delete mode 100644 NorthstarDLL/include/libzip/lib/bz2.lib delete mode 100644 NorthstarDLL/include/libzip/lib/pkgconfig/bzip2.pc delete mode 100644 NorthstarDLL/include/libzip/lib/pkgconfig/libzip.pc delete mode 100644 NorthstarDLL/include/libzip/lib/pkgconfig/zlib.pc delete mode 100644 NorthstarDLL/include/libzip/lib/zip.lib delete mode 100644 NorthstarDLL/include/libzip/lib/zlib.lib delete mode 100644 NorthstarDLL/include/libzip/share/bzip2/copyright delete mode 100644 NorthstarDLL/include/libzip/share/bzip2/usage delete mode 100644 NorthstarDLL/include/libzip/share/bzip2/vcpkg.spdx.json delete mode 100644 NorthstarDLL/include/libzip/share/bzip2/vcpkg_abi_info.txt delete mode 100644 NorthstarDLL/include/libzip/share/libzip/copyright delete mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-config-version.cmake delete mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-config.cmake delete mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-targets-debug.cmake delete mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-targets-release.cmake delete mode 100644 NorthstarDLL/include/libzip/share/libzip/libzip-targets.cmake delete mode 100644 NorthstarDLL/include/libzip/share/libzip/vcpkg.spdx.json delete mode 100644 NorthstarDLL/include/libzip/share/libzip/vcpkg_abi_info.txt delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/copyright delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg-port-config.cmake delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg.spdx.json delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_abi_info.txt delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/copyright delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg-port-config.cmake delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg.spdx.json delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_abi_info.txt delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_build.cmake delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_configure.cmake delete mode 100644 NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_install.cmake delete mode 100644 NorthstarDLL/include/libzip/share/zlib/copyright delete mode 100644 NorthstarDLL/include/libzip/share/zlib/usage delete mode 100644 NorthstarDLL/include/libzip/share/zlib/vcpkg-cmake-wrapper.cmake delete mode 100644 NorthstarDLL/include/libzip/share/zlib/vcpkg.spdx.json delete mode 100644 NorthstarDLL/include/libzip/share/zlib/vcpkg_abi_info.txt delete mode 100644 NorthstarDLL/include/libzip/tools/bzip2/bzip2.exe delete mode 100644 NorthstarDLL/include/libzip/tools/bzip2/bzip2recover.exe diff --git a/NorthstarDLL/include/libzip/include/bzlib.h b/NorthstarDLL/include/libzip/include/bzlib.h deleted file mode 100644 index 015f8d1cb..000000000 --- a/NorthstarDLL/include/libzip/include/bzlib.h +++ /dev/null @@ -1,276 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Public header file for the library. ---*/ -/*--- bzlib.h ---*/ -/*-------------------------------------------------------------*/ - -/* ------------------------------------------------------------------ - This file is part of bzip2/libbzip2, a program and library for - lossless, block-sorting data compression. - - bzip2/libbzip2 version 1.0.8 of 13 July 2019 - Copyright (C) 1996-2019 Julian Seward - - Please read the WARNING, DISCLAIMER and PATENTS sections in the - README file. - - This program is released under the terms of the license contained - in the file LICENSE. - ------------------------------------------------------------------ */ - - -#ifndef _BZLIB_H -#define _BZLIB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define BZ_RUN 0 -#define BZ_FLUSH 1 -#define BZ_FINISH 2 - -#define BZ_OK 0 -#define BZ_RUN_OK 1 -#define BZ_FLUSH_OK 2 -#define BZ_FINISH_OK 3 -#define BZ_STREAM_END 4 -#define BZ_SEQUENCE_ERROR (-1) -#define BZ_PARAM_ERROR (-2) -#define BZ_MEM_ERROR (-3) -#define BZ_DATA_ERROR (-4) -#define BZ_DATA_ERROR_MAGIC (-5) -#define BZ_IO_ERROR (-6) -#define BZ_UNEXPECTED_EOF (-7) -#define BZ_OUTBUFF_FULL (-8) -#define BZ_CONFIG_ERROR (-9) - -typedef - struct { - char *next_in; - unsigned int avail_in; - unsigned int total_in_lo32; - unsigned int total_in_hi32; - - char *next_out; - unsigned int avail_out; - unsigned int total_out_lo32; - unsigned int total_out_hi32; - - void *state; - - void *(*bzalloc)(void *,int,int); - void (*bzfree)(void *,void *); - void *opaque; - } - bz_stream; - -#ifndef BZ_NO_STDIO -/* Need a definitition for FILE */ -#include -#endif - -#ifdef _WIN32 -# ifdef small - /* windows.h define small to char */ -# undef small -# endif -# define BZ_API(func) func -# if defined(BZ_BUILD_DLL) -# define BZ_EXTERN __declspec(dllexport) -# elif 1 -# define BZ_EXTERN __declspec(dllimport) -# else -# define BZ_EXTERN -# endif -#else -# define BZ_API(func) func -# define BZ_EXTERN extern -#endif - - -/*-- Core (low-level) library functions --*/ - -BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( - bz_stream* strm, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN int BZ_API(BZ2_bzCompress) ( - bz_stream* strm, - int action - ); - -BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( - bz_stream* strm - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( - bz_stream *strm, - int verbosity, - int small - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( - bz_stream* strm - ); - -BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( - bz_stream *strm - ); - - - -/*-- High(er) level library functions --*/ - -#ifndef BZ_NO_STDIO -#define BZ_MAX_UNUSED 5000 - -typedef void BZFILE; - -BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( - int* bzerror, - FILE* f, - int verbosity, - int small, - void* unused, - int nUnused - ); - -BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( - int* bzerror, - BZFILE* b - ); - -BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( - int* bzerror, - BZFILE* b, - void** unused, - int* nUnused - ); - -BZ_EXTERN int BZ_API(BZ2_bzRead) ( - int* bzerror, - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( - int* bzerror, - FILE* f, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN void BZ_API(BZ2_bzWrite) ( - int* bzerror, - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( - int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in, - unsigned int* nbytes_out - ); - -BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( - int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in_lo32, - unsigned int* nbytes_in_hi32, - unsigned int* nbytes_out_lo32, - unsigned int* nbytes_out_hi32 - ); -#endif - - -/*-- Utility functions --*/ - -BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( - char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int blockSize100k, - int verbosity, - int workFactor - ); - -BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( - char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int small, - int verbosity - ); - - -/*-- - Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) - to support better zlib compatibility. - This code is not _officially_ part of libbzip2 (yet); - I haven't tested it, documented it, or considered the - threading-safeness of it. - If this code breaks, please contact both Yoshioka and me. ---*/ - -BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( - void - ); - -#ifndef BZ_NO_STDIO -BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( - const char *path, - const char *mode - ); - -BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( - int fd, - const char *mode - ); - -BZ_EXTERN int BZ_API(BZ2_bzread) ( - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN int BZ_API(BZ2_bzwrite) ( - BZFILE* b, - void* buf, - int len - ); - -BZ_EXTERN int BZ_API(BZ2_bzflush) ( - BZFILE* b - ); - -BZ_EXTERN void BZ_API(BZ2_bzclose) ( - BZFILE* b - ); - -BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( - BZFILE *b, - int *errnum - ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -/*-------------------------------------------------------------*/ -/*--- end bzlib.h ---*/ -/*-------------------------------------------------------------*/ diff --git a/NorthstarDLL/include/libzip/include/zconf.h b/NorthstarDLL/include/libzip/include/zconf.h deleted file mode 100644 index b3309e8f7..000000000 --- a/NorthstarDLL/include/libzip/include/zconf.h +++ /dev/null @@ -1,557 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H -/* #undef Z_PREFIX */ -/* #undef Z_HAVE_UNISTD_H */ - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set - * this permanently in zconf.h using "./configure --zprefix". - */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ -# define Z_PREFIX_SET - -/* all linked symbols and init macros */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_bits z__tr_flush_bits -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# define adler32_z z_adler32_z -# ifndef Z_SOLO -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# endif -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define crc32_combine_gen z_crc32_combine_gen -# define crc32_combine_gen64 z_crc32_combine_gen64 -# define crc32_combine_op z_crc32_combine_op -# define crc32_z z_crc32_z -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateGetDictionary z_deflateGetDictionary -# define deflateInit z_deflateInit -# define deflateInit2 z_deflateInit2 -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePending z_deflatePending -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateResetKeep z_deflateResetKeep -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# ifndef Z_SOLO -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzfread z_gzfread -# define gzfwrite z_gzfwrite -# define gzgetc z_gzgetc -# define gzgetc_ z_gzgetc_ -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# ifdef _WIN32 -# define gzopen_w z_gzopen_w -# endif -# define gzprintf z_gzprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzvprintf z_gzvprintf -# define gzwrite z_gzwrite -# endif -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit z_inflateBackInit -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCodesUsed z_inflateCodesUsed -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetDictionary z_inflateGetDictionary -# define inflateGetHeader z_inflateGetHeader -# define inflateInit z_inflateInit -# define inflateInit2 z_inflateInit2 -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateResetKeep z_inflateResetKeep -# define inflateSetDictionary z_inflateSetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflateValidate z_inflateValidate -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# ifndef Z_SOLO -# define uncompress z_uncompress -# define uncompress2 z_uncompress2 -# endif -# define zError z_zError -# ifndef Z_SOLO -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# endif -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion - -/* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# ifndef Z_SOLO -# define gzFile z_gzFile -# endif -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf - -/* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state - -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -#if defined(ZLIB_CONST) && !defined(z_const) -# define z_const const -#else -# define z_const -#endif - -#ifdef Z_SOLO - typedef unsigned long z_size_t; -#else -# define z_longlong long long -# if defined(NO_SIZE_T) - typedef unsigned NO_SIZE_T z_size_t; -# elif defined(STDC) -# include - typedef size_t z_size_t; -# else - typedef unsigned long z_size_t; -# endif -# undef z_longlong -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus about 7 kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# if 1 -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# if 1 -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) -# include -# if (UINT_MAX == 0xffffffffUL) -# define Z_U4 unsigned -# elif (ULONG_MAX == 0xffffffffUL) -# define Z_U4 unsigned long -# elif (USHRT_MAX == 0xffffffffUL) -# define Z_U4 unsigned short -# endif -#endif - -#ifdef Z_U4 - typedef Z_U4 z_crc_t; -#else - typedef unsigned long z_crc_t; -#endif - -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ -# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 -# define Z_HAVE_UNISTD_H -# elif HAVE_UNISTD_H != 0 -# define Z_HAVE_UNISTD_H -# endif -#endif - -#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ -# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 -# define Z_HAVE_STDARG_H -# elif HAVE_STDARG_H != 0 -# define Z_HAVE_STDARG_H -# endif -#endif - -#ifdef STDC -# ifndef Z_SOLO -# include /* for off_t */ -# endif -#endif - -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -# include /* for va_list */ -# endif -#endif - -#ifdef _WIN32 -# ifndef Z_SOLO -# include /* for wchar_t */ -# endif -#endif - -/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and - * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even - * though the former does not conform to the LFS document), but considering - * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as - * equivalently requesting no 64-bit operations - */ -#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE -#endif - -#ifndef Z_HAVE_UNISTD_H -# ifdef __WATCOMC__ -# define Z_HAVE_UNISTD_H -# endif -#endif -#ifndef Z_HAVE_UNISTD_H -# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32) -# define Z_HAVE_UNISTD_H -# endif -#endif -#ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) -# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ -# ifdef VMS -# include /* for off_t */ -# endif -# ifndef z_off_t -# define z_off_t off_t -# endif -# endif -#endif - -#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 -# define Z_LFS64 -#endif - -#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) -# define Z_LARGE64 -#endif - -#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) -# define Z_WANT64 -#endif - -#if !defined(SEEK_SET) && !defined(Z_SOLO) -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#ifndef z_off_t -# define z_off_t long -#endif - -#if !defined(_WIN32) && defined(Z_LARGE64) -# define z_off64_t off64_t -#else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 -# else -# define z_off64_t z_off_t -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/NorthstarDLL/include/libzip/include/zip.h b/NorthstarDLL/include/libzip/include/zip.h deleted file mode 100644 index 283607a5a..000000000 --- a/NorthstarDLL/include/libzip/include/zip.h +++ /dev/null @@ -1,487 +0,0 @@ -#ifndef _HAD_ZIP_H -#define _HAD_ZIP_H - -/* - zip.h -- exported declarations. - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner - - This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - 3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS - OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* fix autoindent */ -#endif -#endif - -#include - -#ifndef ZIP_EXTERN -#ifndef ZIP_STATIC -#ifdef _WIN32 -#define ZIP_EXTERN __declspec(dllimport) -#elif defined(__GNUC__) && __GNUC__ >= 4 -#define ZIP_EXTERN __attribute__((visibility("default"))) -#else -#define ZIP_EXTERN -#endif -#else -#define ZIP_EXTERN -#endif -#endif - -#include -#include -#include - -/* flags for zip_open */ - -#define ZIP_CREATE 1 -#define ZIP_EXCL 2 -#define ZIP_CHECKCONS 4 -#define ZIP_TRUNCATE 8 -#define ZIP_RDONLY 16 - - -/* flags for zip_name_locate, zip_fopen, zip_stat, ... */ - -#define ZIP_FL_NOCASE 1u /* ignore case on name lookup */ -#define ZIP_FL_NODIR 2u /* ignore directory component */ -#define ZIP_FL_COMPRESSED 4u /* read compressed data */ -#define ZIP_FL_UNCHANGED 8u /* use original data, ignoring changes */ -#define ZIP_FL_RECOMPRESS 16u /* force recompression of data */ -#define ZIP_FL_ENCRYPTED 32u /* read encrypted data (implies ZIP_FL_COMPRESSED) */ -#define ZIP_FL_ENC_GUESS 0u /* guess string encoding (is default) */ -#define ZIP_FL_ENC_RAW 64u /* get unmodified string */ -#define ZIP_FL_ENC_STRICT 128u /* follow specification strictly */ -#define ZIP_FL_LOCAL 256u /* in local header */ -#define ZIP_FL_CENTRAL 512u /* in central directory */ -/* 1024u reserved for internal use */ -#define ZIP_FL_ENC_UTF_8 2048u /* string is UTF-8 encoded */ -#define ZIP_FL_ENC_CP437 4096u /* string is CP437 encoded */ -#define ZIP_FL_OVERWRITE 8192u /* zip_file_add: if file with name exists, overwrite (replace) it */ - -/* archive global flags flags */ - -#define ZIP_AFL_RDONLY 2u /* read only -- cannot be cleared */ - - -/* create a new extra field */ - -#define ZIP_EXTRA_FIELD_ALL ZIP_UINT16_MAX -#define ZIP_EXTRA_FIELD_NEW ZIP_UINT16_MAX - - -/* libzip error codes */ - -#define ZIP_ER_OK 0 /* N No error */ -#define ZIP_ER_MULTIDISK 1 /* N Multi-disk zip archives not supported */ -#define ZIP_ER_RENAME 2 /* S Renaming temporary file failed */ -#define ZIP_ER_CLOSE 3 /* S Closing zip archive failed */ -#define ZIP_ER_SEEK 4 /* S Seek error */ -#define ZIP_ER_READ 5 /* S Read error */ -#define ZIP_ER_WRITE 6 /* S Write error */ -#define ZIP_ER_CRC 7 /* N CRC error */ -#define ZIP_ER_ZIPCLOSED 8 /* N Containing zip archive was closed */ -#define ZIP_ER_NOENT 9 /* N No such file */ -#define ZIP_ER_EXISTS 10 /* N File already exists */ -#define ZIP_ER_OPEN 11 /* S Can't open file */ -#define ZIP_ER_TMPOPEN 12 /* S Failure to create temporary file */ -#define ZIP_ER_ZLIB 13 /* Z Zlib error */ -#define ZIP_ER_MEMORY 14 /* N Malloc failure */ -#define ZIP_ER_CHANGED 15 /* N Entry has been changed */ -#define ZIP_ER_COMPNOTSUPP 16 /* N Compression method not supported */ -#define ZIP_ER_EOF 17 /* N Premature end of file */ -#define ZIP_ER_INVAL 18 /* N Invalid argument */ -#define ZIP_ER_NOZIP 19 /* N Not a zip archive */ -#define ZIP_ER_INTERNAL 20 /* N Internal error */ -#define ZIP_ER_INCONS 21 /* L Zip archive inconsistent */ -#define ZIP_ER_REMOVE 22 /* S Can't remove file */ -#define ZIP_ER_DELETED 23 /* N Entry has been deleted */ -#define ZIP_ER_ENCRNOTSUPP 24 /* N Encryption method not supported */ -#define ZIP_ER_RDONLY 25 /* N Read-only archive */ -#define ZIP_ER_NOPASSWD 26 /* N No password provided */ -#define ZIP_ER_WRONGPASSWD 27 /* N Wrong password provided */ -#define ZIP_ER_OPNOTSUPP 28 /* N Operation not supported */ -#define ZIP_ER_INUSE 29 /* N Resource still in use */ -#define ZIP_ER_TELL 30 /* S Tell error */ -#define ZIP_ER_COMPRESSED_DATA 31 /* N Compressed data invalid */ -#define ZIP_ER_CANCELLED 32 /* N Operation cancelled */ - -/* type of system error value */ - -#define ZIP_ET_NONE 0 /* sys_err unused */ -#define ZIP_ET_SYS 1 /* sys_err is errno */ -#define ZIP_ET_ZLIB 2 /* sys_err is zlib error code */ -#define ZIP_ET_LIBZIP 3 /* sys_err is libzip error code */ - -/* compression methods */ - -#define ZIP_CM_DEFAULT -1 /* better of deflate or store */ -#define ZIP_CM_STORE 0 /* stored (uncompressed) */ -#define ZIP_CM_SHRINK 1 /* shrunk */ -#define ZIP_CM_REDUCE_1 2 /* reduced with factor 1 */ -#define ZIP_CM_REDUCE_2 3 /* reduced with factor 2 */ -#define ZIP_CM_REDUCE_3 4 /* reduced with factor 3 */ -#define ZIP_CM_REDUCE_4 5 /* reduced with factor 4 */ -#define ZIP_CM_IMPLODE 6 /* imploded */ -/* 7 - Reserved for Tokenizing compression algorithm */ -#define ZIP_CM_DEFLATE 8 /* deflated */ -#define ZIP_CM_DEFLATE64 9 /* deflate64 */ -#define ZIP_CM_PKWARE_IMPLODE 10 /* PKWARE imploding */ -/* 11 - Reserved by PKWARE */ -#define ZIP_CM_BZIP2 12 /* compressed using BZIP2 algorithm */ -/* 13 - Reserved by PKWARE */ -#define ZIP_CM_LZMA 14 /* LZMA (EFS) */ -/* 15-17 - Reserved by PKWARE */ -#define ZIP_CM_TERSE 18 /* compressed using IBM TERSE (new) */ -#define ZIP_CM_LZ77 19 /* IBM LZ77 z Architecture (PFS) */ -/* 20 - old value for Zstandard */ -#define ZIP_CM_LZMA2 33 -#define ZIP_CM_ZSTD 93 /* Zstandard compressed data */ -#define ZIP_CM_XZ 95 /* XZ compressed data */ -#define ZIP_CM_JPEG 96 /* Compressed Jpeg data */ -#define ZIP_CM_WAVPACK 97 /* WavPack compressed data */ -#define ZIP_CM_PPMD 98 /* PPMd version I, Rev 1 */ - -/* encryption methods */ - -#define ZIP_EM_NONE 0 /* not encrypted */ -#define ZIP_EM_TRAD_PKWARE 1 /* traditional PKWARE encryption */ -#if 0 /* Strong Encryption Header not parsed yet */ -#define ZIP_EM_DES 0x6601 /* strong encryption: DES */ -#define ZIP_EM_RC2_OLD 0x6602 /* strong encryption: RC2, version < 5.2 */ -#define ZIP_EM_3DES_168 0x6603 -#define ZIP_EM_3DES_112 0x6609 -#define ZIP_EM_PKZIP_AES_128 0x660e -#define ZIP_EM_PKZIP_AES_192 0x660f -#define ZIP_EM_PKZIP_AES_256 0x6610 -#define ZIP_EM_RC2 0x6702 /* strong encryption: RC2, version >= 5.2 */ -#define ZIP_EM_RC4 0x6801 -#endif -#define ZIP_EM_AES_128 0x0101 /* Winzip AES encryption */ -#define ZIP_EM_AES_192 0x0102 -#define ZIP_EM_AES_256 0x0103 -#define ZIP_EM_UNKNOWN 0xffff /* unknown algorithm */ - -#define ZIP_OPSYS_DOS 0x00u -#define ZIP_OPSYS_AMIGA 0x01u -#define ZIP_OPSYS_OPENVMS 0x02u -#define ZIP_OPSYS_UNIX 0x03u -#define ZIP_OPSYS_VM_CMS 0x04u -#define ZIP_OPSYS_ATARI_ST 0x05u -#define ZIP_OPSYS_OS_2 0x06u -#define ZIP_OPSYS_MACINTOSH 0x07u -#define ZIP_OPSYS_Z_SYSTEM 0x08u -#define ZIP_OPSYS_CPM 0x09u -#define ZIP_OPSYS_WINDOWS_NTFS 0x0au -#define ZIP_OPSYS_MVS 0x0bu -#define ZIP_OPSYS_VSE 0x0cu -#define ZIP_OPSYS_ACORN_RISC 0x0du -#define ZIP_OPSYS_VFAT 0x0eu -#define ZIP_OPSYS_ALTERNATE_MVS 0x0fu -#define ZIP_OPSYS_BEOS 0x10u -#define ZIP_OPSYS_TANDEM 0x11u -#define ZIP_OPSYS_OS_400 0x12u -#define ZIP_OPSYS_OS_X 0x13u - -#define ZIP_OPSYS_DEFAULT ZIP_OPSYS_UNIX - - -enum zip_source_cmd { - ZIP_SOURCE_OPEN, /* prepare for reading */ - ZIP_SOURCE_READ, /* read data */ - ZIP_SOURCE_CLOSE, /* reading is done */ - ZIP_SOURCE_STAT, /* get meta information */ - ZIP_SOURCE_ERROR, /* get error information */ - ZIP_SOURCE_FREE, /* cleanup and free resources */ - ZIP_SOURCE_SEEK, /* set position for reading */ - ZIP_SOURCE_TELL, /* get read position */ - ZIP_SOURCE_BEGIN_WRITE, /* prepare for writing */ - ZIP_SOURCE_COMMIT_WRITE, /* writing is done */ - ZIP_SOURCE_ROLLBACK_WRITE, /* discard written changes */ - ZIP_SOURCE_WRITE, /* write data */ - ZIP_SOURCE_SEEK_WRITE, /* set position for writing */ - ZIP_SOURCE_TELL_WRITE, /* get write position */ - ZIP_SOURCE_SUPPORTS, /* check whether source supports command */ - ZIP_SOURCE_REMOVE, /* remove file */ - ZIP_SOURCE_RESERVED_1, /* previously used internally */ - ZIP_SOURCE_BEGIN_WRITE_CLONING, /* like ZIP_SOURCE_BEGIN_WRITE, but keep part of original file */ - ZIP_SOURCE_ACCEPT_EMPTY, /* whether empty files are valid archives */ - ZIP_SOURCE_GET_FILE_ATTRIBUTES /* get additional file attributes */ -}; -typedef enum zip_source_cmd zip_source_cmd_t; - -#define ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd) (((zip_int64_t)1) << (cmd)) - -#define ZIP_SOURCE_CHECK_SUPPORTED(supported, cmd) (((supported) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd)) != 0) - -/* clang-format off */ - -#define ZIP_SOURCE_SUPPORTS_READABLE (ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_OPEN) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_READ) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_CLOSE) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_STAT) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ERROR) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_FREE)) - -#define ZIP_SOURCE_SUPPORTS_SEEKABLE (ZIP_SOURCE_SUPPORTS_READABLE \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_TELL) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SUPPORTS)) - -#define ZIP_SOURCE_SUPPORTS_WRITABLE (ZIP_SOURCE_SUPPORTS_SEEKABLE \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_BEGIN_WRITE) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_COMMIT_WRITE) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ROLLBACK_WRITE) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_WRITE) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK_WRITE) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_TELL_WRITE) \ - | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_REMOVE)) - -/* clang-format on */ - -/* for use by sources */ -struct zip_source_args_seek { - zip_int64_t offset; - int whence; -}; - -typedef struct zip_source_args_seek zip_source_args_seek_t; -#define ZIP_SOURCE_GET_ARGS(type, data, len, error) ((len) < sizeof(type) ? zip_error_set((error), ZIP_ER_INVAL, 0), (type *)NULL : (type *)(data)) - - -/* error information */ -/* use zip_error_*() to access */ -struct zip_error { - int zip_err; /* libzip error code (ZIP_ER_*) */ - int sys_err; /* copy of errno (E*) or zlib error code */ - char *_Nullable str; /* string representation or NULL */ -}; - -#define ZIP_STAT_NAME 0x0001u -#define ZIP_STAT_INDEX 0x0002u -#define ZIP_STAT_SIZE 0x0004u -#define ZIP_STAT_COMP_SIZE 0x0008u -#define ZIP_STAT_MTIME 0x0010u -#define ZIP_STAT_CRC 0x0020u -#define ZIP_STAT_COMP_METHOD 0x0040u -#define ZIP_STAT_ENCRYPTION_METHOD 0x0080u -#define ZIP_STAT_FLAGS 0x0100u - -struct zip_stat { - zip_uint64_t valid; /* which fields have valid values */ - const char *_Nullable name; /* name of the file */ - zip_uint64_t index; /* index within archive */ - zip_uint64_t size; /* size of file (uncompressed) */ - zip_uint64_t comp_size; /* size of file (compressed) */ - time_t mtime; /* modification time */ - zip_uint32_t crc; /* crc of file data */ - zip_uint16_t comp_method; /* compression method used */ - zip_uint16_t encryption_method; /* encryption method used */ - zip_uint32_t flags; /* reserved for future use */ -}; - -struct zip_buffer_fragment { - zip_uint8_t *_Nonnull data; - zip_uint64_t length; -}; - -struct zip_file_attributes { - zip_uint64_t valid; /* which fields have valid values */ - zip_uint8_t version; /* version of this struct, currently 1 */ - zip_uint8_t host_system; /* host system on which file was created */ - zip_uint8_t ascii; /* flag whether file is ASCII text */ - zip_uint8_t version_needed; /* minimum version needed to extract file */ - zip_uint32_t external_file_attributes; /* external file attributes (host-system specific) */ - zip_uint16_t general_purpose_bit_flags; /* general purpose big flags, only some bits are honored */ - zip_uint16_t general_purpose_bit_mask; /* which bits in general_purpose_bit_flags are valid */ -}; - -#define ZIP_FILE_ATTRIBUTES_HOST_SYSTEM 0x0001u -#define ZIP_FILE_ATTRIBUTES_ASCII 0x0002u -#define ZIP_FILE_ATTRIBUTES_VERSION_NEEDED 0x0004u -#define ZIP_FILE_ATTRIBUTES_EXTERNAL_FILE_ATTRIBUTES 0x0008u -#define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS 0x0010u - -struct zip; -struct zip_file; -struct zip_source; - -typedef struct zip zip_t; -typedef struct zip_error zip_error_t; -typedef struct zip_file zip_file_t; -typedef struct zip_file_attributes zip_file_attributes_t; -typedef struct zip_source zip_source_t; -typedef struct zip_stat zip_stat_t; -typedef struct zip_buffer_fragment zip_buffer_fragment_t; - -typedef zip_uint32_t zip_flags_t; - -typedef zip_int64_t (*zip_source_callback)(void *_Nullable, void *_Nullable, zip_uint64_t, zip_source_cmd_t); -typedef void (*zip_progress_callback)(zip_t *_Nonnull, double, void *_Nullable); -typedef int (*zip_cancel_callback)(zip_t *_Nonnull, void *_Nullable); - -#ifndef ZIP_DISABLE_DEPRECATED -typedef void (*zip_progress_callback_t)(double); -ZIP_EXTERN void zip_register_progress_callback(zip_t *_Nonnull, zip_progress_callback_t _Nullable); /* use zip_register_progress_callback_with_state */ - -ZIP_EXTERN zip_int64_t zip_add(zip_t *_Nonnull, const char *_Nonnull, zip_source_t *_Nonnull); /* use zip_file_add */ -ZIP_EXTERN zip_int64_t zip_add_dir(zip_t *_Nonnull, const char *_Nonnull); /* use zip_dir_add */ -ZIP_EXTERN const char *_Nullable zip_get_file_comment(zip_t *_Nonnull, zip_uint64_t, int *_Nullable, int); /* use zip_file_get_comment */ -ZIP_EXTERN int zip_get_num_files(zip_t *_Nonnull); /* use zip_get_num_entries instead */ -ZIP_EXTERN int zip_rename(zip_t *_Nonnull, zip_uint64_t, const char *_Nonnull); /* use zip_file_rename */ -ZIP_EXTERN int zip_replace(zip_t *_Nonnull, zip_uint64_t, zip_source_t *_Nonnull); /* use zip_file_replace */ -ZIP_EXTERN int zip_set_file_comment(zip_t *_Nonnull, zip_uint64_t, const char *_Nullable, int); /* use zip_file_set_comment */ -ZIP_EXTERN int zip_error_get_sys_type(int); /* use zip_error_system_type */ -ZIP_EXTERN void zip_error_get(zip_t *_Nonnull, int *_Nullable, int *_Nullable); /* use zip_get_error, zip_error_code_zip / zip_error_code_system */ -ZIP_EXTERN int zip_error_to_str(char *_Nonnull, zip_uint64_t, int, int); /* use zip_error_init_with_code / zip_error_strerror */ -ZIP_EXTERN void zip_file_error_get(zip_file_t *_Nonnull, int *_Nullable, int *_Nullable); /* use zip_file_get_error, zip_error_code_zip / zip_error_code_system */ -#endif - -ZIP_EXTERN int zip_close(zip_t *_Nonnull); -ZIP_EXTERN int zip_delete(zip_t *_Nonnull, zip_uint64_t); -ZIP_EXTERN zip_int64_t zip_dir_add(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t); -ZIP_EXTERN void zip_discard(zip_t *_Nonnull); - -ZIP_EXTERN zip_error_t *_Nonnull zip_get_error(zip_t *_Nonnull); -ZIP_EXTERN void zip_error_clear(zip_t *_Nonnull); -ZIP_EXTERN int zip_error_code_zip(const zip_error_t *_Nonnull); -ZIP_EXTERN int zip_error_code_system(const zip_error_t *_Nonnull); -ZIP_EXTERN void zip_error_fini(zip_error_t *_Nonnull); -ZIP_EXTERN void zip_error_init(zip_error_t *_Nonnull); -ZIP_EXTERN void zip_error_init_with_code(zip_error_t *_Nonnull, int); -ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int); -ZIP_EXTERN const char *_Nonnull zip_error_strerror(zip_error_t *_Nonnull); -ZIP_EXTERN int zip_error_system_type(const zip_error_t *_Nonnull); -ZIP_EXTERN zip_int64_t zip_error_to_data(const zip_error_t *_Nonnull, void *_Nonnull, zip_uint64_t); - -ZIP_EXTERN int zip_fclose(zip_file_t *_Nonnull); -ZIP_EXTERN zip_t *_Nullable zip_fdopen(int, int, int *_Nullable); -ZIP_EXTERN zip_int64_t zip_file_add(zip_t *_Nonnull, const char *_Nonnull, zip_source_t *_Nonnull, zip_flags_t); -ZIP_EXTERN void zip_file_attributes_init(zip_file_attributes_t *_Nonnull); -ZIP_EXTERN void zip_file_error_clear(zip_file_t *_Nonnull); -ZIP_EXTERN int zip_file_extra_field_delete(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_flags_t); -ZIP_EXTERN int zip_file_extra_field_delete_by_id(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_flags_t); -ZIP_EXTERN int zip_file_extra_field_set(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, const zip_uint8_t *_Nullable, zip_uint16_t, zip_flags_t); -ZIP_EXTERN zip_int16_t zip_file_extra_fields_count(zip_t *_Nonnull, zip_uint64_t, zip_flags_t); -ZIP_EXTERN zip_int16_t zip_file_extra_fields_count_by_id(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_flags_t); -ZIP_EXTERN const zip_uint8_t *_Nullable zip_file_extra_field_get(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t *_Nullable, zip_uint16_t *_Nullable, zip_flags_t); -ZIP_EXTERN const zip_uint8_t *_Nullable zip_file_extra_field_get_by_id(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_uint16_t *_Nullable, zip_flags_t); -ZIP_EXTERN const char *_Nullable zip_file_get_comment(zip_t *_Nonnull, zip_uint64_t, zip_uint32_t *_Nullable, zip_flags_t); -ZIP_EXTERN zip_error_t *_Nonnull zip_file_get_error(zip_file_t *_Nonnull); -ZIP_EXTERN int zip_file_get_external_attributes(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint8_t *_Nullable, zip_uint32_t *_Nullable); -ZIP_EXTERN int zip_file_is_seekable(zip_file_t *_Nonnull); -ZIP_EXTERN int zip_file_rename(zip_t *_Nonnull, zip_uint64_t, const char *_Nonnull, zip_flags_t); -ZIP_EXTERN int zip_file_replace(zip_t *_Nonnull, zip_uint64_t, zip_source_t *_Nonnull, zip_flags_t); -ZIP_EXTERN int zip_file_set_comment(zip_t *_Nonnull, zip_uint64_t, const char *_Nullable, zip_uint16_t, zip_flags_t); -ZIP_EXTERN int zip_file_set_dostime(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_flags_t); -ZIP_EXTERN int zip_file_set_encryption(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, const char *_Nullable); -ZIP_EXTERN int zip_file_set_external_attributes(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint8_t, zip_uint32_t); -ZIP_EXTERN int zip_file_set_mtime(zip_t *_Nonnull, zip_uint64_t, time_t, zip_flags_t); -ZIP_EXTERN const char *_Nonnull zip_file_strerror(zip_file_t *_Nonnull); -ZIP_EXTERN zip_file_t *_Nullable zip_fopen(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t); -ZIP_EXTERN zip_file_t *_Nullable zip_fopen_encrypted(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t, const char *_Nullable); -ZIP_EXTERN zip_file_t *_Nullable zip_fopen_index(zip_t *_Nonnull, zip_uint64_t, zip_flags_t); -ZIP_EXTERN zip_file_t *_Nullable zip_fopen_index_encrypted(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, const char *_Nullable); -ZIP_EXTERN zip_int64_t zip_fread(zip_file_t *_Nonnull, void *_Nonnull, zip_uint64_t); -ZIP_EXTERN zip_int8_t zip_fseek(zip_file_t *_Nonnull, zip_int64_t, int); -ZIP_EXTERN zip_int64_t zip_ftell(zip_file_t *_Nonnull); -ZIP_EXTERN const char *_Nullable zip_get_archive_comment(zip_t *_Nonnull, int *_Nullable, zip_flags_t); -ZIP_EXTERN int zip_get_archive_flag(zip_t *_Nonnull, zip_flags_t, zip_flags_t); -ZIP_EXTERN const char *_Nullable zip_get_name(zip_t *_Nonnull, zip_uint64_t, zip_flags_t); -ZIP_EXTERN zip_int64_t zip_get_num_entries(zip_t *_Nonnull, zip_flags_t); -ZIP_EXTERN const char *_Nonnull zip_libzip_version(void); -ZIP_EXTERN zip_int64_t zip_name_locate(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t); -ZIP_EXTERN zip_t *_Nullable zip_open(const char *_Nonnull, int, int *_Nullable); -ZIP_EXTERN zip_t *_Nullable zip_open_from_source(zip_source_t *_Nonnull, int, zip_error_t *_Nullable); -ZIP_EXTERN int zip_register_progress_callback_with_state(zip_t *_Nonnull, double, zip_progress_callback _Nullable, void (*_Nullable)(void *_Nullable), void *_Nullable); -ZIP_EXTERN int zip_register_cancel_callback_with_state(zip_t *_Nonnull, zip_cancel_callback _Nullable, void (*_Nullable)(void *_Nullable), void *_Nullable); -ZIP_EXTERN int zip_set_archive_comment(zip_t *_Nonnull, const char *_Nullable, zip_uint16_t); -ZIP_EXTERN int zip_set_archive_flag(zip_t *_Nonnull, zip_flags_t, int); -ZIP_EXTERN int zip_set_default_password(zip_t *_Nonnull, const char *_Nullable); -ZIP_EXTERN int zip_set_file_compression(zip_t *_Nonnull, zip_uint64_t, zip_int32_t, zip_uint32_t); -ZIP_EXTERN int zip_source_begin_write(zip_source_t *_Nonnull); -ZIP_EXTERN int zip_source_begin_write_cloning(zip_source_t *_Nonnull, zip_uint64_t); -ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer(zip_t *_Nonnull, const void *_Nullable, zip_uint64_t, int); -ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_create(const void *_Nullable, zip_uint64_t, int, zip_error_t *_Nullable); -ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_fragment(zip_t *_Nonnull, const zip_buffer_fragment_t *_Nonnull, zip_uint64_t, int); -ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_fragment_create(const zip_buffer_fragment_t *_Nullable, zip_uint64_t, int, zip_error_t *_Nullable); -ZIP_EXTERN int zip_source_close(zip_source_t *_Nonnull); -ZIP_EXTERN int zip_source_commit_write(zip_source_t *_Nonnull); -ZIP_EXTERN zip_error_t *_Nonnull zip_source_error(zip_source_t *_Nonnull); -ZIP_EXTERN zip_source_t *_Nullable zip_source_file(zip_t *_Nonnull, const char *_Nonnull, zip_uint64_t, zip_int64_t); -ZIP_EXTERN zip_source_t *_Nullable zip_source_file_create(const char *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); -ZIP_EXTERN zip_source_t *_Nullable zip_source_filep(zip_t *_Nonnull, FILE *_Nonnull, zip_uint64_t, zip_int64_t); -ZIP_EXTERN zip_source_t *_Nullable zip_source_filep_create(FILE *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); -ZIP_EXTERN void zip_source_free(zip_source_t *_Nullable); -ZIP_EXTERN zip_source_t *_Nullable zip_source_function(zip_t *_Nonnull, zip_source_callback _Nonnull, void *_Nullable); -ZIP_EXTERN zip_source_t *_Nullable zip_source_function_create(zip_source_callback _Nonnull, void *_Nullable, zip_error_t *_Nullable); -ZIP_EXTERN int zip_source_get_file_attributes(zip_source_t *_Nonnull, zip_file_attributes_t *_Nonnull); -ZIP_EXTERN int zip_source_is_deleted(zip_source_t *_Nonnull); -ZIP_EXTERN void zip_source_keep(zip_source_t *_Nonnull); -ZIP_EXTERN zip_int64_t zip_source_make_command_bitmap(zip_source_cmd_t, ...); -ZIP_EXTERN int zip_source_open(zip_source_t *_Nonnull); -ZIP_EXTERN zip_int64_t zip_source_read(zip_source_t *_Nonnull, void *_Nonnull, zip_uint64_t); -ZIP_EXTERN void zip_source_rollback_write(zip_source_t *_Nonnull); -ZIP_EXTERN int zip_source_seek(zip_source_t *_Nonnull, zip_int64_t, int); -ZIP_EXTERN zip_int64_t zip_source_seek_compute_offset(zip_uint64_t, zip_uint64_t, void *_Nonnull, zip_uint64_t, zip_error_t *_Nullable); -ZIP_EXTERN int zip_source_seek_write(zip_source_t *_Nonnull, zip_int64_t, int); -ZIP_EXTERN int zip_source_stat(zip_source_t *_Nonnull, zip_stat_t *_Nonnull); -ZIP_EXTERN zip_int64_t zip_source_tell(zip_source_t *_Nonnull); -ZIP_EXTERN zip_int64_t zip_source_tell_write(zip_source_t *_Nonnull); -#ifdef _WIN32 -ZIP_EXTERN zip_source_t *zip_source_win32a(zip_t *, const char *, zip_uint64_t, zip_int64_t); -ZIP_EXTERN zip_source_t *zip_source_win32a_create(const char *, zip_uint64_t, zip_int64_t, zip_error_t *); -ZIP_EXTERN zip_source_t *zip_source_win32handle(zip_t *, void *, zip_uint64_t, zip_int64_t); -ZIP_EXTERN zip_source_t *zip_source_win32handle_create(void *, zip_uint64_t, zip_int64_t, zip_error_t *); -ZIP_EXTERN zip_source_t *zip_source_win32w(zip_t *, const wchar_t *, zip_uint64_t, zip_int64_t); -ZIP_EXTERN zip_source_t *zip_source_win32w_create(const wchar_t *, zip_uint64_t, zip_int64_t, zip_error_t *); -#endif -ZIP_EXTERN zip_source_t *_Nullable zip_source_window_create(zip_source_t *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); -ZIP_EXTERN zip_int64_t zip_source_write(zip_source_t *_Nonnull, const void *_Nullable, zip_uint64_t); -ZIP_EXTERN zip_source_t *_Nullable zip_source_zip(zip_t *_Nonnull, zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t); -ZIP_EXTERN zip_source_t *_Nullable zip_source_zip_create(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); -ZIP_EXTERN int zip_stat(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t, zip_stat_t *_Nonnull); -ZIP_EXTERN int zip_stat_index(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_stat_t *_Nonnull); -ZIP_EXTERN void zip_stat_init(zip_stat_t *_Nonnull); -ZIP_EXTERN const char *_Nonnull zip_strerror(zip_t *_Nonnull); -ZIP_EXTERN int zip_unchange(zip_t *_Nonnull, zip_uint64_t); -ZIP_EXTERN int zip_unchange_all(zip_t *_Nonnull); -ZIP_EXTERN int zip_unchange_archive(zip_t *_Nonnull); -ZIP_EXTERN int zip_compression_method_supported(zip_int32_t method, int compress); -ZIP_EXTERN int zip_encryption_method_supported(zip_uint16_t method, int encode); - -#ifdef __cplusplus -} -#endif - -#endif /* _HAD_ZIP_H */ diff --git a/NorthstarDLL/include/libzip/include/zipconf.h b/NorthstarDLL/include/libzip/include/zipconf.h deleted file mode 100644 index 8c03513a5..000000000 --- a/NorthstarDLL/include/libzip/include/zipconf.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _HAD_ZIPCONF_H -#define _HAD_ZIPCONF_H - -/* - zipconf.h -- platform specific include file - - This file was generated automatically by CMake - based on ../cmake-zipconf.h.in. - */ - -#define LIBZIP_VERSION "1.9.2" -#define LIBZIP_VERSION_MAJOR 1 -#define LIBZIP_VERSION_MINOR 9 -#define LIBZIP_VERSION_MICRO 2 - -/* #undef ZIP_STATIC */ - -#define _Nullable -#define _Nonnull - -#if !defined(__STDC_FORMAT_MACROS) -#define __STDC_FORMAT_MACROS 1 -#endif -#include - -typedef int8_t zip_int8_t; -typedef uint8_t zip_uint8_t; -typedef int16_t zip_int16_t; -typedef uint16_t zip_uint16_t; -typedef int32_t zip_int32_t; -typedef uint32_t zip_uint32_t; -typedef int64_t zip_int64_t; -typedef uint64_t zip_uint64_t; - -#define ZIP_INT8_MIN (-ZIP_INT8_MAX-1) -#define ZIP_INT8_MAX 0x7f -#define ZIP_UINT8_MAX 0xff - -#define ZIP_INT16_MIN (-ZIP_INT16_MAX-1) -#define ZIP_INT16_MAX 0x7fff -#define ZIP_UINT16_MAX 0xffff - -#define ZIP_INT32_MIN (-ZIP_INT32_MAX-1L) -#define ZIP_INT32_MAX 0x7fffffffL -#define ZIP_UINT32_MAX 0xffffffffLU - -#define ZIP_INT64_MIN (-ZIP_INT64_MAX-1LL) -#define ZIP_INT64_MAX 0x7fffffffffffffffLL -#define ZIP_UINT64_MAX 0xffffffffffffffffULL - -#endif /* zipconf.h */ diff --git a/NorthstarDLL/include/libzip/include/zlib.h b/NorthstarDLL/include/libzip/include/zlib.h deleted file mode 100644 index 953cb5012..000000000 --- a/NorthstarDLL/include/libzip/include/zlib.h +++ /dev/null @@ -1,1935 +0,0 @@ -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.13, October 13th, 2022 - - Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 - (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). -*/ - -#ifndef ZLIB_H -#define ZLIB_H - -#include "zconf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ZLIB_VERSION "1.2.13" -#define ZLIB_VERNUM 0x12d0 -#define ZLIB_VER_MAJOR 1 -#define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 13 -#define ZLIB_VER_SUBREVISION 0 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed data. - This version of the library supports only one compression method (deflation) - but other algorithms will be added later and will have the same stream - interface. - - Compression can be done in a single step if the buffers are large enough, - or can be done by repeated calls of the compression function. In the latter - case, the application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip and raw deflate streams in - memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never crash - even in the case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - z_const Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total number of input bytes read so far */ - - Bytef *next_out; /* next output byte will go here */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total number of bytes output so far */ - - z_const char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text - for deflate, or the decoding state for inflate */ - uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - -/* - gzip header information passed to and from zlib routines. See RFC 1952 - for more details on the meanings of these fields. -*/ -typedef struct gz_header_s { - int text; /* true if compressed data believed to be text */ - uLong time; /* modification time */ - int xflags; /* extra flags (not used when writing a gzip file) */ - int os; /* operating system */ - Bytef *extra; /* pointer to extra field or Z_NULL if none */ - uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ - uInt extra_max; /* space at extra (only when reading header) */ - Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ - uInt name_max; /* space at name (only when reading header) */ - Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ - uInt comm_max; /* space at comment (only when reading header) */ - int hcrc; /* true if there was or will be a header crc */ - int done; /* true when done reading gzip header (not used - when writing a gzip file) */ -} gz_header; - -typedef gz_header FAR *gz_headerp; - -/* - The application must update next_in and avail_in when avail_in has dropped - to zero. It must update next_out and avail_out when avail_out has dropped - to zero. The application must initialize zalloc, zfree and opaque before - calling the init function. All other fields are set by the compression - library and must not be updated by the application. - - The opaque value provided by the application will be passed as the first - parameter for calls of zalloc and zfree. This can be useful for custom - memory management. The compression library attaches no meaning to the - opaque value. - - zalloc must return Z_NULL if there is not enough memory for the object. - If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. In that case, zlib is thread-safe. When zalloc and zfree are - Z_NULL on entry to the initialization function, they are set to internal - routines that use the standard library functions malloc() and free(). - - On 16-bit systems, the functions zalloc and zfree must be able to allocate - exactly 65536 bytes, but will not be required to allocate more than this if - the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers - returned by zalloc for objects of exactly 65536 bytes *must* have their - offset normalized to zero. The default allocation function provided by this - library ensures this (see zutil.c). To reduce memory requirements and avoid - any allocation of 64K objects, at the expense of compression ratio, compile - the library with -DMAX_WBITS=14 (see zconf.h). - - The fields total_in and total_out can be used for statistics or progress - reports. After compression, total_in holds the total size of the - uncompressed data and may be saved for use by the decompressor (particularly - if the decompressor wants to decompress everything in a single step). -*/ - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -#define Z_TREES 6 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field for deflate() */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define zlib_version zlibVersion() -/* for compatibility with versions < 1.0.2 */ - - - /* basic functions */ - -ZEXTERN const char * ZEXPORT zlibVersion OF((void)); -/* The application can compare zlibVersion and ZLIB_VERSION for consistency. - If the first character differs, the library code actually used is not - compatible with the zlib.h header file used by the application. This check - is automatically made by deflateInit and inflateInit. - */ - -/* -ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); - - Initializes the internal stream state for compression. The fields - zalloc, zfree and opaque must be initialized before by the caller. If - zalloc and zfree are set to Z_NULL, deflateInit updates them to use default - allocation functions. - - The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: - 1 gives best speed, 9 gives best compression, 0 gives no compression at all - (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION - requests a default compromise between speed and compression (currently - equivalent to level 6). - - deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if level is not a valid compression level, or - Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible - with the version assumed by the caller (ZLIB_VERSION). msg is set to null - if there is no error message. deflateInit does not perform any compression: - this will be done by deflate(). -*/ - - -ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); -/* - deflate compresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. deflate performs one or both of the - following actions: - - - Compress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in and avail_in are updated and - processing will resume at this point for the next call of deflate(). - - - Generate more output starting at next_out and update next_out and avail_out - accordingly. This action is forced if the parameter flush is non zero. - Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary. Some output may be provided even if - flush is zero. - - Before the call of deflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating avail_in or avail_out accordingly; avail_out should - never be zero before the call. The application can consume the compressed - output when it wants, for example when the output buffer is full (avail_out - == 0), or after each call of deflate(). If deflate returns Z_OK and with - zero avail_out, it must be called again after making room in the output - buffer because there might be more output pending. See deflatePending(), - which can be used if desired to determine whether or not there is more output - in that case. - - Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to - decide how much data to accumulate before producing output, in order to - maximize compression. - - If the parameter flush is set to Z_SYNC_FLUSH, all pending output is - flushed to the output buffer and the output is aligned on a byte boundary, so - that the decompressor can get all input data available so far. (In - particular avail_in is zero after the call if enough output space has been - provided before the call.) Flushing may degrade compression for some - compression algorithms and so it should be used only when necessary. This - completes the current deflate block and follows it with an empty stored block - that is three bits plus filler bits to the next byte, followed by four bytes - (00 00 ff ff). - - If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the - output buffer, but the output is not aligned to a byte boundary. All of the - input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. - This completes the current deflate block and follows it with an empty fixed - codes block that is 10 bits long. This assures that enough bytes are output - in order for the decompressor to finish the block before the empty fixed - codes block. - - If flush is set to Z_BLOCK, a deflate block is completed and emitted, as - for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to - seven bits of the current block are held to be written as the next byte after - the next deflate block is completed. In this case, the decompressor may not - be provided enough bits at this point in order to complete decompression of - the data provided so far to the compressor. It may need to wait for the next - block to be emitted. This is for advanced applications that need to control - the emission of deflate blocks. - - If flush is set to Z_FULL_FLUSH, all output is flushed as with - Z_SYNC_FLUSH, and the compression state is reset so that decompression can - restart from this point if previous compressed data has been damaged or if - random access is desired. Using Z_FULL_FLUSH too often can seriously degrade - compression. - - If deflate returns with avail_out == 0, this function must be called again - with the same value of the flush parameter and more output space (updated - avail_out), until the flush is complete (deflate returns with non-zero - avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that - avail_out is greater than six to avoid repeated flush markers due to - avail_out == 0 on return. - - If the parameter flush is set to Z_FINISH, pending input is processed, - pending output is flushed and deflate returns with Z_STREAM_END if there was - enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this - function must be called again with Z_FINISH and more output space (updated - avail_out) but no more input data, until it returns with Z_STREAM_END or an - error. After deflate has returned Z_STREAM_END, the only possible operations - on the stream are deflateReset or deflateEnd. - - Z_FINISH can be used in the first deflate call after deflateInit if all the - compression is to be done in a single step. In order to complete in one - call, avail_out must be at least the value returned by deflateBound (see - below). Then deflate is guaranteed to return Z_STREAM_END. If not enough - output space is provided, deflate will not return Z_STREAM_END, and it must - be called again as described above. - - deflate() sets strm->adler to the Adler-32 checksum of all input read - so far (that is, total_in bytes). If a gzip stream is being generated, then - strm->adler will be the CRC-32 checksum of the input read so far. (See - deflateInit2 below.) - - deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is - considered binary. This field is only for information purposes and does not - affect the compression algorithm in any manner. - - deflate() returns Z_OK if some progress has been made (more input - processed or more output produced), Z_STREAM_END if all input has been - consumed and all output has been produced (only when flush is set to - Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was Z_NULL or the state was inadvertently written over - by the application), or Z_BUF_ERROR if no progress is possible (for example - avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and - deflate() can be called again with more input and more output space to - continue compressing. -*/ - - -ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the - stream state was inconsistent, Z_DATA_ERROR if the stream was freed - prematurely (some input or output was discarded). In the error case, msg - may be set but then points to a static string (which must not be - deallocated). -*/ - - -/* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); - - Initializes the internal stream state for decompression. The fields - next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. In the current version of inflate, the provided input is not - read or consumed. The allocation of a sliding window will be deferred to - the first call of inflate (if the decompression does not complete on the - first call). If zalloc and zfree are set to Z_NULL, inflateInit updates - them to use default allocation functions. - - inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit does not perform any decompression. - Actual decompression will be done by inflate(). So next_in, and avail_in, - next_out, and avail_out are unused and unchanged. The current - implementation of inflateInit() does not process any header information -- - that is deferred until inflate() is called. -*/ - - -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); -/* - inflate decompresses as much data as possible, and stops when the input - buffer becomes empty or the output buffer becomes full. It may introduce - some output latency (reading input without producing any output) except when - forced to flush. - - The detailed semantics are as follows. inflate performs one or both of the - following actions: - - - Decompress more input starting at next_in and update next_in and avail_in - accordingly. If not all input can be processed (because there is not - enough room in the output buffer), then next_in and avail_in are updated - accordingly, and processing will resume at this point for the next call of - inflate(). - - - Generate more output starting at next_out and update next_out and avail_out - accordingly. inflate() provides as much output as possible, until there is - no more input data or no more space in the output buffer (see below about - the flush parameter). - - Before the call of inflate(), the application should ensure that at least - one of the actions is possible, by providing more input and/or consuming more - output, and updating the next_* and avail_* values accordingly. If the - caller of inflate() does not provide both available input and available - output space, it is possible that there will be no progress made. The - application can consume the uncompressed output when it wants, for example - when the output buffer is full (avail_out == 0), or after each call of - inflate(). If inflate returns Z_OK and with zero avail_out, it must be - called again after making room in the output buffer because there might be - more output pending. - - The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, - Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much - output as possible to the output buffer. Z_BLOCK requests that inflate() - stop if and when it gets to the next deflate block boundary. When decoding - the zlib or gzip format, this will cause inflate() to return immediately - after the header and before the first block. When doing a raw inflate, - inflate() will go ahead and process the first block, and will return when it - gets to the end of that block, or when it runs out of data. - - The Z_BLOCK option assists in appending to or combining deflate streams. - To assist in this, on return inflate() always sets strm->data_type to the - number of unused bits in the last byte taken from strm->next_in, plus 64 if - inflate() is currently decoding the last block in the deflate stream, plus - 128 if inflate() returned immediately after decoding an end-of-block code or - decoding the complete header up to just before the first byte of the deflate - stream. The end-of-block will not be indicated until all of the uncompressed - data from that block has been written to strm->next_out. The number of - unused bits may in general be greater than seven, except when bit 7 of - data_type is set, in which case the number of unused bits will be less than - eight. data_type is set as noted here every time inflate() returns for all - flush options, and so can be used to determine the amount of currently - consumed input in bits. - - The Z_TREES option behaves as Z_BLOCK does, but it also returns when the - end of each deflate block header is reached, before any actual data in that - block is decoded. This allows the caller to determine the length of the - deflate block header for later use in random access within a deflate block. - 256 is added to the value of strm->data_type when inflate() returns - immediately after reaching the end of the deflate block header. - - inflate() should normally be called until it returns Z_STREAM_END or an - error. However if all decompression is to be performed in a single step (a - single call of inflate), the parameter flush should be set to Z_FINISH. In - this case all pending input is processed and all pending output is flushed; - avail_out must be large enough to hold all of the uncompressed data for the - operation to complete. (The size of the uncompressed data may have been - saved by the compressor for this purpose.) The use of Z_FINISH is not - required to perform an inflation in one step. However it may be used to - inform inflate that a faster approach can be used for the single inflate() - call. Z_FINISH also informs inflate to not maintain a sliding window if the - stream completes, which reduces inflate's memory footprint. If the stream - does not complete, either because not all of the stream is provided or not - enough output space is provided, then a sliding window will be allocated and - inflate() can be called again to continue the operation as if Z_NO_FLUSH had - been used. - - In this implementation, inflate() always flushes as much output as - possible to the output buffer, and always uses the faster approach on the - first call. So the effects of the flush parameter in this implementation are - on the return value of inflate() as noted below, when inflate() returns early - when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of - memory for a sliding window when Z_FINISH is used. - - If a preset dictionary is needed after this call (see inflateSetDictionary - below), inflate sets strm->adler to the Adler-32 checksum of the dictionary - chosen by the compressor and returns Z_NEED_DICT; otherwise it sets - strm->adler to the Adler-32 checksum of all output produced so far (that is, - total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed Adler-32 - checksum is equal to that saved by the compressor and returns Z_STREAM_END - only if the checksum is correct. - - inflate() can decompress and check either zlib-wrapped or gzip-wrapped - deflate data. The header type is detected automatically, if requested when - initializing with inflateInit2(). Any information contained in the gzip - header is not retained unless inflateGetHeader() is used. When processing - gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output - produced so far. The CRC-32 is checked against the gzip trailer, as is the - uncompressed length, modulo 2^32. - - inflate() returns Z_OK if some progress has been made (more input processed - or more output produced), Z_STREAM_END if the end of the compressed data has - been reached and all uncompressed output has been produced, Z_NEED_DICT if a - preset dictionary is needed at this point, Z_DATA_ERROR if the input data was - corrupted (input stream not conforming to the zlib format or incorrect check - value, in which case strm->msg points to a string with a more specific - error), Z_STREAM_ERROR if the stream structure was inconsistent (for example - next_in or next_out was Z_NULL, or the state was inadvertently written over - by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR - if no progress was possible or if there was not enough room in the output - buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and - inflate() can be called again with more input and more output space to - continue decompressing. If Z_DATA_ERROR is returned, the application may - then call inflateSync() to look for a good compression block if a partial - recovery of the data is to be attempted. -*/ - - -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); -/* - All dynamically allocated data structures for this stream are freed. - This function discards any unprocessed input and does not flush any pending - output. - - inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state - was inconsistent. -*/ - - - /* Advanced functions */ - -/* - The following functions are needed only in some special applications. -*/ - -/* -ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, - int level, - int method, - int windowBits, - int memLevel, - int strategy)); - - This is another version of deflateInit with more compression options. The - fields zalloc, zfree and opaque must be initialized before by the caller. - - The method parameter is the compression method. It must be Z_DEFLATED in - this version of the library. - - The windowBits parameter is the base two logarithm of the window size - (the size of the history buffer). It should be in the range 8..15 for this - version of the library. Larger values of this parameter result in better - compression at the expense of memory usage. The default value is 15 if - deflateInit is used instead. - - For the current implementation of deflate(), a windowBits value of 8 (a - window size of 256 bytes) is not supported. As a result, a request for 8 - will result in 9 (a 512-byte window). In that case, providing 8 to - inflateInit2() will result in an error when the zlib header with 9 is - checked against the initialization of inflate(). The remedy is to not use 8 - with deflateInit2() with this initialization, or at least in that case use 9 - with inflateInit2(). - - windowBits can also be -8..-15 for raw deflate. In this case, -windowBits - determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute a check value. - - windowBits can also be greater than 15 for optional gzip encoding. Add - 16 to windowBits to write a simple gzip header and trailer around the - compressed data instead of a zlib wrapper. The gzip header will have no - file name, no extra data, no comment, no modification time (set to zero), no - header crc, and the operating system will be set to the appropriate value, - if the operating system was determined at compile time. If a gzip stream is - being written, strm->adler is a CRC-32 instead of an Adler-32. - - For raw deflate or gzip encoding, a request for a 256-byte window is - rejected as invalid, since only the zlib header provides a means of - transmitting the window size to the decompressor. - - The memLevel parameter specifies how much memory should be allocated - for the internal compression state. memLevel=1 uses minimum memory but is - slow and reduces compression ratio; memLevel=9 uses maximum memory for - optimal speed. The default value is 8. See zconf.h for total memory usage - as a function of windowBits and memLevel. - - The strategy parameter is used to tune the compression algorithm. Use the - value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a - filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no - string match), or Z_RLE to limit match distances to one (run-length - encoding). Filtered data consists mostly of small values with a somewhat - random distribution. In this case, the compression algorithm is tuned to - compress them better. The effect of Z_FILTERED is to force more Huffman - coding and less string matching; it is somewhat intermediate between - Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as - fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The - strategy parameter only affects the compression ratio but not the - correctness of the compressed output even if it is not set appropriately. - Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler - decoder for special applications. - - deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid - method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is - incompatible with the version assumed by the caller (ZLIB_VERSION). msg is - set to null if there is no error message. deflateInit2 does not perform any - compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the compression dictionary from the given byte sequence - without producing any compressed output. When using the zlib format, this - function must be called immediately after deflateInit, deflateInit2 or - deflateReset, and before any call of deflate. When doing raw deflate, this - function must be called either before any call of deflate, or immediately - after the completion of a deflate block, i.e. after all input has been - consumed and all output has been delivered when using any of the flush - options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The - compressor and decompressor must use exactly the same dictionary (see - inflateSetDictionary). - - The dictionary should consist of strings (byte sequences) that are likely - to be encountered later in the data to be compressed, with the most commonly - used strings preferably put towards the end of the dictionary. Using a - dictionary is most useful when the data to be compressed is short and can be - predicted with good accuracy; the data can then be compressed better than - with the default empty dictionary. - - Depending on the size of the compression data structures selected by - deflateInit or deflateInit2, a part of the dictionary may in effect be - discarded, for example if the dictionary is larger than the window size - provided in deflateInit or deflateInit2. Thus the strings most likely to be - useful should be put at the end of the dictionary, not at the front. In - addition, the current implementation of deflate will use at most the window - size minus 262 bytes of the provided dictionary. - - Upon return of this function, strm->adler is set to the Adler-32 value - of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The Adler-32 value - applies to the whole dictionary even if only a subset of the dictionary is - actually used by the compressor.) If a raw deflate was requested, then the - Adler-32 value is not computed and strm->adler is not set. - - deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent (for example if deflate has already been called for this stream - or if not at a block boundary for raw deflate). deflateSetDictionary does - not perform any compression: this will be done by deflate(). -*/ - -ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); -/* - Returns the sliding dictionary being maintained by deflate. dictLength is - set to the number of bytes in the dictionary, and that many bytes are copied - to dictionary. dictionary must have enough space, where 32768 bytes is - always enough. If deflateGetDictionary() is called with dictionary equal to - Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similarly, if dictLength is Z_NULL, then it is not set. - - deflateGetDictionary() may return a length less than the window size, even - when more than the window size in input has been provided. It may return up - to 258 bytes less in that case, due to how zlib's implementation of deflate - manages the sliding window and lookahead for matches, where matches can be - up to 258 bytes long. If the application needs the last window-size bytes of - input, then that would need to be saved by the application outside of zlib. - - deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the - stream state is inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when several compression strategies will be - tried, for example when there are several ways of pre-processing the input - data with a filter. The streams that will be discarded should then be freed - by calling deflateEnd. Note that deflateCopy duplicates the internal - compression state which can be quite large, so this strategy is slow and can - consume lots of memory. - - deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); -/* - This function is equivalent to deflateEnd followed by deflateInit, but - does not free and reallocate the internal compression state. The stream - will leave the compression level and any other attributes that may have been - set unchanged. - - deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, - int level, - int strategy)); -/* - Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2(). This can be - used to switch between compression and straight copy of the input data, or - to switch to a different kind of input data requiring a different strategy. - If the compression approach (which is a function of the level) or the - strategy is changed, and if there have been any deflate() calls since the - state was initialized or reset, then the input available so far is - compressed with the old level and strategy using deflate(strm, Z_BLOCK). - There are three approaches for the compression levels 0, 1..3, and 4..9 - respectively. The new level and strategy will take effect at the next call - of deflate(). - - If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does - not have enough output space to complete, then the parameter change will not - take effect. In this case, deflateParams() can be called again with the - same parameters and more output space to try again. - - In order to assure a change in the parameters on the first try, the - deflate stream should be flushed using deflate() with Z_BLOCK or other flush - request until strm.avail_out is not zero, before calling deflateParams(). - Then no more input data should be provided before the deflateParams() call. - If this is done, the old level and strategy will be applied to the data - compressed before deflateParams(), and the new level and strategy will be - applied to the the data compressed after deflateParams(). - - deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream - state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if - there was not enough output space to complete the compression of the - available input data before a change in the strategy or approach. Note that - in the case of a Z_BUF_ERROR, the parameters are not changed. A return - value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be - retried with more output space. -*/ - -ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, - int good_length, - int max_lazy, - int nice_length, - int max_chain)); -/* - Fine tune deflate's internal compression parameters. This should only be - used by someone who understands the algorithm used by zlib's deflate for - searching for the best matching string, and even then only by the most - fanatic optimizer trying to squeeze out the last compressed bit for their - specific input data. Read the deflate.c source code for the meaning of the - max_lazy, good_length, nice_length, and max_chain parameters. - - deflateTune() can be called after deflateInit() or deflateInit2(), and - returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. - */ - -ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, - uLong sourceLen)); -/* - deflateBound() returns an upper bound on the compressed size after - deflation of sourceLen bytes. It must be called after deflateInit() or - deflateInit2(), and after deflateSetHeader(), if used. This would be used - to allocate an output buffer for deflation in a single pass, and so would be - called before deflate(). If that first deflate() call is provided the - sourceLen input bytes, an output buffer allocated to the size returned by - deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed - to return Z_STREAM_END. Note that it is possible for the compressed size to - be larger than the value returned by deflateBound() if flush options other - than Z_FINISH or Z_NO_FLUSH are used. -*/ - -ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, - unsigned *pending, - int *bits)); -/* - deflatePending() returns the number of bytes and bits of output that have - been generated, but not yet provided in the available output. The bytes not - provided would be due to the available output space having being consumed. - The number of bits of output not provided are between 0 and 7, where they - await more bits to join them in order to fill out a full byte. If pending - or bits are Z_NULL, then those values are not set. - - deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. - */ - -ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - deflatePrime() inserts bits in the deflate output stream. The intent - is that this function is used to start off the deflate output with the bits - leftover from a previous deflate stream when appending to it. As such, this - function can only be used for raw deflate, and must be used before the first - deflate() call after a deflateInit2() or deflateReset(). bits must be less - than or equal to 16, and that many of the least significant bits of value - will be inserted in the output. - - deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough - room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, - gz_headerp head)); -/* - deflateSetHeader() provides gzip header information for when a gzip - stream is requested by deflateInit2(). deflateSetHeader() may be called - after deflateInit2() or deflateReset() and before the first call of - deflate(). The text, time, os, extra field, name, and comment information - in the provided gz_header structure are written to the gzip header (xflag is - ignored -- the extra flags are set according to the compression level). The - caller must assure that, if not Z_NULL, name and comment are terminated with - a zero byte, and that if extra is not Z_NULL, that extra_len bytes are - available there. If hcrc is true, a gzip header crc is included. Note that - the current versions of the command-line version of gzip (up through version - 1.3.x) do not support header crc's, and will report that it is a "multi-part - gzip file" and give up. - - If deflateSetHeader is not used, the default gzip header has text false, - the time set to zero, and os set to 255, with no extra, name, or comment - fields. The gzip header is returned to the default state by deflateReset(). - - deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, - int windowBits)); - - This is another version of inflateInit with an extra parameter. The - fields next_in, avail_in, zalloc, zfree and opaque must be initialized - before by the caller. - - The windowBits parameter is the base two logarithm of the maximum window - size (the size of the history buffer). It should be in the range 8..15 for - this version of the library. The default value is 15 if inflateInit is used - instead. windowBits must be greater than or equal to the windowBits value - provided to deflateInit2() while compressing, or it must be equal to 15 if - deflateInit2() was not used. If a compressed stream with a larger window - size is given as input, inflate() will return with the error code - Z_DATA_ERROR instead of trying to allocate a larger window. - - windowBits can also be zero to request that inflate use the window size in - the zlib header of the compressed stream. - - windowBits can also be -8..-15 for raw inflate. In this case, -windowBits - determines the window size. inflate() will then process raw deflate data, - not looking for a zlib or gzip header, not generating a check value, and not - looking for any check values for comparison at the end of the stream. This - is for use with other formats that use the deflate compressed data format - such as zip. Those formats provide their own check values. If a custom - format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an Adler-32 or a CRC-32 be applied to - the uncompressed data as is done in the zlib, gzip, and zip formats. For - most applications, the zlib format should be used as is. Note that comments - above on the use in deflateInit2() applies to the magnitude of windowBits. - - windowBits can also be greater than 15 for optional gzip decoding. Add - 32 to windowBits to enable zlib and gzip decoding with automatic header - detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a - CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see - below), inflate() will *not* automatically decode concatenated gzip members. - inflate() will return Z_STREAM_END at the end of the gzip member. The state - would need to be reset to continue decoding a subsequent gzip member. This - *must* be done if there is more data after a gzip member, in order for the - decompression to be compliant with the gzip standard (RFC 1952). - - inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_VERSION_ERROR if the zlib library version is incompatible with the - version assumed by the caller, or Z_STREAM_ERROR if the parameters are - invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit2 does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit2() does not process any header information -- that is - deferred until inflate() is called. -*/ - -ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, - const Bytef *dictionary, - uInt dictLength)); -/* - Initializes the decompression dictionary from the given uncompressed byte - sequence. This function must be called immediately after a call of inflate, - if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the Adler-32 value returned by that call of inflate. - The compressor and decompressor must use exactly the same dictionary (see - deflateSetDictionary). For raw inflate, this function can be called at any - time to set the dictionary. If the provided dictionary is smaller than the - window and there is already data in the window, then the provided dictionary - will amend what's there. The application must insure that the dictionary - that was used for compression is provided. - - inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a - parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is - inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect Adler-32 value). inflateSetDictionary does not - perform any decompression: this will be done by subsequent calls of - inflate(). -*/ - -ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, - Bytef *dictionary, - uInt *dictLength)); -/* - Returns the sliding dictionary being maintained by inflate. dictLength is - set to the number of bytes in the dictionary, and that many bytes are copied - to dictionary. dictionary must have enough space, where 32768 bytes is - always enough. If inflateGetDictionary() is called with dictionary equal to - Z_NULL, then only the dictionary length is returned, and nothing is copied. - Similarly, if dictLength is Z_NULL, then it is not set. - - inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the - stream state is inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); -/* - Skips invalid compressed data until a possible full flush point (see above - for the description of deflate with Z_FULL_FLUSH) can be found, or until all - available input is skipped. No output is provided. - - inflateSync searches for a 00 00 FF FF pattern in the compressed data. - All full flush points have this pattern, but not all occurrences of this - pattern are full flush points. - - inflateSync returns Z_OK if a possible full flush point has been found, - Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point - has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. -*/ - -ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, - z_streamp source)); -/* - Sets the destination stream as a complete copy of the source stream. - - This function can be useful when randomly accessing a large stream. The - first pass through the stream can periodically record the inflate state, - allowing restarting inflate at those points when randomly accessing the - stream. - - inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_STREAM_ERROR if the source stream state was inconsistent - (such as zalloc being Z_NULL). msg is left unchanged in both source and - destination. -*/ - -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); -/* - This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate the internal decompression state. The - stream will keep attributes that may have been set by inflateInit2. - - inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL). -*/ - -ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, - int windowBits)); -/* - This function is the same as inflateReset, but it also permits changing - the wrap and window size requests. The windowBits parameter is interpreted - the same as it is for inflateInit2. If the window size is changed, then the - memory allocated for the window is freed, and the window will be reallocated - by inflate() if needed. - - inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent (such as zalloc or state being Z_NULL), or if - the windowBits parameter is invalid. -*/ - -ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, - int bits, - int value)); -/* - This function inserts bits in the inflate input stream. The intent is - that this function is used to start inflating at a bit position in the - middle of a byte. The provided bits will be used before any bytes are used - from next_in. This function should only be used with raw inflate, and - should be used before the first inflate() call after inflateInit2() or - inflateReset(). bits must be less than or equal to 16, and that many of the - least significant bits of value will be inserted in the input. - - If bits is negative, then the input stream bit buffer is emptied. Then - inflatePrime() can be called again to put bits in the buffer. This is used - to clear out bits leftover after feeding inflate a block description prior - to feeding inflate codes. - - inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); -/* - This function returns two values, one in the lower 16 bits of the return - value, and the other in the remaining upper bits, obtained by shifting the - return value down 16 bits. If the upper value is -1 and the lower value is - zero, then inflate() is currently decoding information outside of a block. - If the upper value is -1 and the lower value is non-zero, then inflate is in - the middle of a stored block, with the lower value equaling the number of - bytes from the input remaining to copy. If the upper value is not -1, then - it is the number of bits back from the current bit position in the input of - the code (literal or length/distance pair) currently being processed. In - that case the lower value is the number of bytes already emitted for that - code. - - A code is being processed if inflate is waiting for more input to complete - decoding of the code, or if it has completed decoding but is waiting for - more output space to write the literal or match data. - - inflateMark() is used to mark locations in the input data for random - access, which may be at bit positions, and to note those cases where the - output of a code may span boundaries of random access blocks. The current - location in the input stream can be determined from avail_in and data_type - as noted in the description for the Z_BLOCK flush parameter for inflate. - - inflateMark returns the value noted above, or -65536 if the provided - source stream state was inconsistent. -*/ - -ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, - gz_headerp head)); -/* - inflateGetHeader() requests that gzip header information be stored in the - provided gz_header structure. inflateGetHeader() may be called after - inflateInit2() or inflateReset(), and before the first call of inflate(). - As inflate() processes the gzip stream, head->done is zero until the header - is completed, at which time head->done is set to one. If a zlib stream is - being decoded, then head->done is set to -1 to indicate that there will be - no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be - used to force inflate() to return immediately after header processing is - complete and before any actual data is decompressed. - - The text, time, xflags, and os fields are filled in with the gzip header - contents. hcrc is set to true if there is a header CRC. (The header CRC - was valid if done is set to one.) If extra is not Z_NULL, then extra_max - contains the maximum number of bytes to write to extra. Once done is true, - extra_len contains the actual extra field length, and extra contains the - extra field, or that field truncated if extra_max is less than extra_len. - If name is not Z_NULL, then up to name_max characters are written there, - terminated with a zero unless the length is greater than name_max. If - comment is not Z_NULL, then up to comm_max characters are written there, - terminated with a zero unless the length is greater than comm_max. When any - of extra, name, or comment are not Z_NULL and the respective field is not - present in the header, then that field is set to Z_NULL to signal its - absence. This allows the use of deflateSetHeader() with the returned - structure to duplicate the header. However if those fields are set to - allocated memory, then the application will need to save those pointers - elsewhere so that they can be eventually freed. - - If inflateGetHeader is not used, then the header information is simply - discarded. The header is always checked for validity, including the header - CRC if present. inflateReset() will reset the process to discard the header - information. The application would need to call inflateGetHeader() again to - retrieve the header from the next gzip stream. - - inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source - stream state was inconsistent. -*/ - -/* -ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, - unsigned char FAR *window)); - - Initialize the internal stream state for decompression using inflateBack() - calls. The fields zalloc, zfree and opaque in strm must be initialized - before the call. If zalloc and zfree are Z_NULL, then the default library- - derived memory allocation routines are used. windowBits is the base two - logarithm of the window size, in the range 8..15. window is a caller - supplied buffer of that size. Except for special applications where it is - assured that deflate was used with small window sizes, windowBits must be 15 - and a 32K byte window must be supplied to be able to decompress general - deflate streams. - - See inflateBack() for the usage of these routines. - - inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the parameters are invalid, Z_MEM_ERROR if the internal state could not be - allocated, or Z_VERSION_ERROR if the version of the library does not match - the version of the header file. -*/ - -typedef unsigned (*in_func) OF((void FAR *, - z_const unsigned char FAR * FAR *)); -typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); - -ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, - in_func in, void FAR *in_desc, - out_func out, void FAR *out_desc)); -/* - inflateBack() does a raw inflate with a single call using a call-back - interface for input and output. This is potentially more efficient than - inflate() for file i/o applications, in that it avoids copying between the - output and the sliding window by simply making the window itself the output - buffer. inflate() can be faster on modern CPUs when used with large - buffers. inflateBack() trusts the application to not change the output - buffer passed by the output function, at least until inflateBack() returns. - - inflateBackInit() must be called first to allocate the internal state - and to initialize the state with the user-provided window buffer. - inflateBack() may then be used multiple times to inflate a complete, raw - deflate stream with each call. inflateBackEnd() is then called to free the - allocated state. - - A raw deflate stream is one with no zlib or gzip header or trailer. - This routine would normally be used in a utility that reads zip or gzip - files and writes out uncompressed files. The utility would decode the - header and process the trailer on its own, hence this routine expects only - the raw deflate stream to decompress. This is different from the default - behavior of inflate(), which expects a zlib header and trailer around the - deflate stream. - - inflateBack() uses two subroutines supplied by the caller that are then - called by inflateBack() for input and output. inflateBack() calls those - routines until it reads a complete deflate stream and writes out all of the - uncompressed data, or until it encounters an error. The function's - parameters and return types are defined above in the in_func and out_func - typedefs. inflateBack() will call in(in_desc, &buf) which should return the - number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero -- buf is ignored in that - case -- and inflateBack() will return a buffer error. inflateBack() will - call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. - out() should return zero on success, or non-zero on failure. If out() - returns non-zero, inflateBack() will return with an error. Neither in() nor - out() are permitted to change the contents of the window provided to - inflateBackInit(), which is also the buffer that out() uses to write from. - The length written by out() will be at most the window size. Any non-zero - amount of input may be provided by in(). - - For convenience, inflateBack() can be provided input on the first call by - setting strm->next_in and strm->avail_in. If that input is exhausted, then - in() will be called. Therefore strm->next_in must be initialized before - calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called - immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in - must also be initialized, and then if strm->avail_in is not zero, input will - initially be taken from strm->next_in[0 .. strm->avail_in - 1]. - - The in_desc and out_desc parameters of inflateBack() is passed as the - first parameter of in() and out() respectively when they are called. These - descriptors can be optionally used to pass any information that the caller- - supplied in() and out() functions need to do their job. - - On return, inflateBack() will set strm->next_in and strm->avail_in to - pass back any unused input that was provided by the last in() call. The - return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR - if in() or out() returned an error, Z_DATA_ERROR if there was a format error - in the deflate stream (in which case strm->msg is set to indicate the nature - of the error), or Z_STREAM_ERROR if the stream was not properly initialized. - In the case of Z_BUF_ERROR, an input or output error can be distinguished - using strm->next_in which will be Z_NULL only if in() returned an error. If - strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning - non-zero. (in() will always be called before out(), so strm->next_in is - assured to be defined if out() returns non-zero.) Note that inflateBack() - cannot return Z_OK. -*/ - -ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); -/* - All memory allocated by inflateBackInit() is freed. - - inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream - state was inconsistent. -*/ - -ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); -/* Return flags indicating compile-time options. - - Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: - 1.0: size of uInt - 3.2: size of uLong - 5.4: size of voidpf (pointer) - 7.6: size of z_off_t - - Compiler, assembler, and debug options: - 8: ZLIB_DEBUG - 9: ASMV or ASMINF -- use ASM code - 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention - 11: 0 (reserved) - - One-time table building (smaller code, but not thread-safe if true): - 12: BUILDFIXED -- build static block decoding tables when needed - 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed - 14,15: 0 (reserved) - - Library content (indicates missing functionality): - 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking - deflate code when not needed) - 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect - and decode gzip streams (to avoid linking crc code) - 18-19: 0 (reserved) - - Operation variations (changes in library functionality): - 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate - 21: FASTEST -- deflate algorithm with only one, lowest compression level - 22,23: 0 (reserved) - - The sprintf variant used by gzprintf (zero is best): - 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format - 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! - 26: 0 = returns value, 1 = void -- 1 means inferred string length returned - - Remainder: - 27-31: 0 (reserved) - */ - -#ifndef Z_SOLO - - /* utility functions */ - -/* - The following utility functions are implemented on top of the basic - stream-oriented functions. To simplify the interface, some default options - are assumed (compression level and memory usage, standard memory allocation - functions). The source code of these utility functions can be modified if - you need special options. -*/ - -ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Compresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed data. compress() is equivalent to compress2() with a level - parameter of Z_DEFAULT_COMPRESSION. - - compress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer. -*/ - -ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen, - int level)); -/* - Compresses the source buffer into the destination buffer. The level - parameter has the same meaning as in deflateInit. sourceLen is the byte - length of the source buffer. Upon entry, destLen is the total size of the - destination buffer, which must be at least the value returned by - compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed data. - - compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough - memory, Z_BUF_ERROR if there was not enough room in the output buffer, - Z_STREAM_ERROR if the level parameter is invalid. -*/ - -ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); -/* - compressBound() returns an upper bound on the compressed size after - compress() or compress2() on sourceLen bytes. It would be used before a - compress() or compress2() call to allocate the destination buffer. -*/ - -ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong sourceLen)); -/* - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total size - of the destination buffer, which must be large enough to hold the entire - uncompressed data. (The size of the uncompressed data must have been saved - previously by the compressor and transmitted to the decompressor by some - mechanism outside the scope of this compression library.) Upon exit, destLen - is the actual size of the uncompressed data. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In - the case where there is not enough room, uncompress() will fill the output - buffer with the uncompressed data up to that point. -*/ - -ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, - const Bytef *source, uLong *sourceLen)); -/* - Same as uncompress, except that sourceLen is a pointer, where the - length of the source is *sourceLen. On return, *sourceLen is the number of - source bytes consumed. -*/ - - /* gzip file access functions */ - -/* - This library supports reading and writing files in gzip (.gz) format with - an interface similar to that of stdio, using the functions that start with - "gz". The gzip format is different from the zlib format. gzip is a gzip - wrapper, documented in RFC 1952, wrapped around a deflate stream. -*/ - -typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ - -/* -ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); - - Open the gzip (.gz) file at path for reading and decompressing, or - compressing and writing. The mode parameter is as in fopen ("rb" or "wb") - but can also include a compression level ("wb9") or a strategy: 'f' for - filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", - 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression - as in "wb9F". (See the description of deflateInit2 for more information - about the strategy parameter.) 'T' will request transparent writing or - appending with no compression and not using the gzip format. - - "a" can be used instead of "w" to request that the gzip stream that will - be written be appended to the file. "+" will result in an error, since - reading and writing to the same gzip file is not supported. The addition of - "x" when writing will create the file exclusively, which fails if the file - already exists. On systems that support it, the addition of "e" when - reading or writing will set the flag to close the file on an execve() call. - - These functions, as well as gzip, will read and decode a sequence of gzip - streams in a file. The append function of gzopen() can be used to create - such a file. (Also see gzflush() for another way to do this.) When - appending, gzopen does not test whether the file begins with a gzip stream, - nor does it look for the end of the gzip streams to begin appending. gzopen - will simply append a gzip stream to the existing file. - - gzopen can be used to read a file which is not in gzip format; in this - case gzread will directly read from the file without decompression. When - reading, this will be detected automatically by looking for the magic two- - byte gzip header. - - gzopen returns NULL if the file could not be opened, if there was - insufficient memory to allocate the gzFile state, or if an invalid mode was - specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). - errno can be checked to determine if the reason gzopen failed was that the - file could not be opened. -*/ - -ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); -/* - Associate a gzFile with the file descriptor fd. File descriptors are - obtained from calls like open, dup, creat, pipe or fileno (if the file has - been previously opened with fopen). The mode parameter is as in gzopen. - - The next call of gzclose on the returned gzFile will also close the file - descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor - fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, - mode);. The duplicated descriptor should be saved to avoid a leak, since - gzdopen does not close fd if it fails. If you are using fileno() to get the - file descriptor from a FILE *, then you will have to use dup() to avoid - double-close()ing the file descriptor. Both gzclose() and fclose() will - close the associated file descriptor, so they need to have different file - descriptors. - - gzdopen returns NULL if there was insufficient memory to allocate the - gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not - provided, or '+' was provided), or if fd is -1. The file descriptor is not - used until the next gz* read, write, seek, or close operation, so gzdopen - will not detect if fd is invalid (unless fd is -1). -*/ - -ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); -/* - Set the internal buffer size used by this library's functions for file to - size. The default buffer size is 8192 bytes. This function must be called - after gzopen() or gzdopen(), and before any other calls that read or write - the file. The buffer memory allocation is always deferred to the first read - or write. Three times that size in buffer space is allocated. A larger - buffer size of, for example, 64K or 128K bytes will noticeably increase the - speed of decompression (reading). - - The new buffer size also affects the maximum length for gzprintf(). - - gzbuffer() returns 0 on success, or -1 on failure, such as being called - too late. -*/ - -ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); -/* - Dynamically update the compression level and strategy for file. See the - description of deflateInit2 for the meaning of these parameters. Previously - provided data is flushed before applying the parameter changes. - - gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not - opened for writing, Z_ERRNO if there is an error writing the flushed data, - or Z_MEM_ERROR if there is a memory allocation error. -*/ - -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); -/* - Read and decompress up to len uncompressed bytes from file into buf. If - the input file is not in gzip format, gzread copies the given number of - bytes into the buffer directly from the file. - - After reaching the end of a gzip stream in the input, gzread will continue - to read, looking for another gzip stream. Any number of gzip streams may be - concatenated in the input file, and will all be decompressed by gzread(). - If something other than a gzip stream is encountered after a gzip stream, - that remaining trailing garbage is ignored (and no error is returned). - - gzread can be used to read a gzip file that is being concurrently written. - Upon reaching the end of the input, gzread will return with the available - data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then - gzclearerr can be used to clear the end of file indicator in order to permit - gzread to be tried again. Z_OK indicates that a gzip stream was completed - on the last gzread. Z_BUF_ERROR indicates that the input file ended in the - middle of a gzip stream. Note that gzread does not return -1 in the event - of an incomplete gzip stream. This error is deferred until gzclose(), which - will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip - stream. Alternatively, gzerror can be used before gzclose to detect this - case. - - gzread returns the number of uncompressed bytes actually read, less than - len for end of file, or -1 for error. If len is too large to fit in an int, - then nothing is read, -1 is returned, and the error state is set to - Z_STREAM_ERROR. -*/ - -ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, - gzFile file)); -/* - Read and decompress up to nitems items of size size from file into buf, - otherwise operating as gzread() does. This duplicates the interface of - stdio's fread(), with size_t request and return types. If the library - defines size_t, then z_size_t is identical to size_t. If not, then z_size_t - is an unsigned integer type that can contain a pointer. - - gzfread() returns the number of full items read of size size, or zero if - the end of the file was reached and a full item could not be read, or if - there was an error. gzerror() must be consulted if zero is returned in - order to determine if there was an error. If the multiplication of size and - nitems overflows, i.e. the product does not fit in a z_size_t, then nothing - is read, zero is returned, and the error state is set to Z_STREAM_ERROR. - - In the event that the end of file is reached and only a partial item is - available at the end, i.e. the remaining uncompressed data length is not a - multiple of size, then the final partial item is nevertheless read into buf - and the end-of-file flag is set. The length of the partial item read is not - provided, but could be inferred from the result of gztell(). This behavior - is the same as the behavior of fread() implementations in common libraries, - but it prevents the direct use of gzfread() to read a concurrently written - file, resetting and retrying on end-of-file, when size is not 1. -*/ - -ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); -/* - Compress and write the len uncompressed bytes at buf to file. gzwrite - returns the number of uncompressed bytes written or 0 in case of error. -*/ - -ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, - z_size_t nitems, gzFile file)); -/* - Compress and write nitems items of size size from buf to file, duplicating - the interface of stdio's fwrite(), with size_t request and return types. If - the library defines size_t, then z_size_t is identical to size_t. If not, - then z_size_t is an unsigned integer type that can contain a pointer. - - gzfwrite() returns the number of full items written of size size, or zero - if there was an error. If the multiplication of size and nitems overflows, - i.e. the product does not fit in a z_size_t, then nothing is written, zero - is returned, and the error state is set to Z_STREAM_ERROR. -*/ - -ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); -/* - Convert, format, compress, and write the arguments (...) to file under - control of the string format, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written, or a negative zlib error code in case - of error. The number of uncompressed bytes written is limited to 8191, or - one less than the buffer size given to gzbuffer(). The caller should assure - that this limit is not exceeded. If it is exceeded, then gzprintf() will - return an error (0) with nothing written. In this case, there may also be a - buffer overflow with unpredictable consequences, which is possible only if - zlib was compiled with the insecure functions sprintf() or vsprintf(), - because the secure snprintf() or vsnprintf() functions were not available. - This can be determined using zlibCompileFlags(). -*/ - -ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); -/* - Compress and write the given null-terminated string s to file, excluding - the terminating null character. - - gzputs returns the number of characters written, or -1 in case of error. -*/ - -ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); -/* - Read and decompress bytes from file into buf, until len-1 characters are - read, or until a newline character is read and transferred to buf, or an - end-of-file condition is encountered. If any characters are read or if len - is one, the string is terminated with a null character. If no characters - are read due to an end-of-file or len is less than one, then the buffer is - left untouched. - - gzgets returns buf which is a null-terminated string, or it returns NULL - for end-of-file or in case of error. If there was an error, the contents at - buf are indeterminate. -*/ - -ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); -/* - Compress and write c, converted to an unsigned char, into file. gzputc - returns the value that was written, or -1 in case of error. -*/ - -ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); -/* - Read and decompress one byte from file. gzgetc returns this byte or -1 - in case of end of file or error. This is implemented as a macro for speed. - As such, it does not do all of the checking the other functions do. I.e. - it does not check to see if file is NULL, nor whether the structure file - points to has been clobbered or not. -*/ - -ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); -/* - Push c back onto the stream for file to be read as the first character on - the next read. At least one character of push-back is always allowed. - gzungetc() returns the character pushed, or -1 on failure. gzungetc() will - fail if c is -1, and may fail if a character has been pushed but not read - yet. If gzungetc is used immediately after gzopen or gzdopen, at least the - output buffer size of pushed characters is allowed. (See gzbuffer above.) - The pushed character will be discarded if the stream is repositioned with - gzseek() or gzrewind(). -*/ - -ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); -/* - Flush all pending output to file. The parameter flush is as in the - deflate() function. The return value is the zlib error number (see function - gzerror below). gzflush is only permitted when writing. - - If the flush parameter is Z_FINISH, the remaining data is written and the - gzip stream is completed in the output. If gzwrite() is called again, a new - gzip stream will be started in the output. gzread() is able to read such - concatenated gzip streams. - - gzflush should be called only when strictly necessary because it will - degrade compression if called too often. -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, - z_off_t offset, int whence)); - - Set the starting position to offset relative to whence for the next gzread - or gzwrite on file. The offset represents a number of bytes in the - uncompressed data stream. The whence parameter is defined as in lseek(2); - the value SEEK_END is not supported. - - If the file is opened for reading, this function is emulated but can be - extremely slow. If the file is opened for writing, only forward seeks are - supported; gzseek then compresses a sequence of zeroes up to the new - starting position. - - gzseek returns the resulting offset location as measured in bytes from - the beginning of the uncompressed stream, or -1 in case of error, in - particular if the file is opened for writing and the new starting position - would be before the current position. -*/ - -ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); -/* - Rewind file. This function is supported only for reading. - - gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET). -*/ - -/* -ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); - - Return the starting position for the next gzread or gzwrite on file. - This position represents a number of bytes in the uncompressed data stream, - and is zero when starting, even if appending or reading a gzip stream from - the middle of a file using gzdopen(). - - gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) -*/ - -/* -ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); - - Return the current compressed (actual) read or write offset of file. This - offset includes the count of bytes that precede the gzip stream, for example - when appending or when using gzdopen() for reading. When reading, the - offset does not include as yet unused buffered input. This information can - be used for a progress indicator. On error, gzoffset() returns -1. -*/ - -ZEXTERN int ZEXPORT gzeof OF((gzFile file)); -/* - Return true (1) if the end-of-file indicator for file has been set while - reading, false (0) otherwise. Note that the end-of-file indicator is set - only if the read tried to go past the end of the input, but came up short. - Therefore, just like feof(), gzeof() may return false even if there is no - more data to read, in the event that the last read request was for the exact - number of bytes remaining in the input file. This will happen if the input - file size is an exact multiple of the buffer size. - - If gzeof() returns true, then the read functions will return no more data, - unless the end-of-file indicator is reset by gzclearerr() and the input file - has grown since the previous end of file was detected. -*/ - -ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); -/* - Return true (1) if file is being copied directly while reading, or false - (0) if file is a gzip stream being decompressed. - - If the input file is empty, gzdirect() will return true, since the input - does not contain a gzip stream. - - If gzdirect() is used immediately after gzopen() or gzdopen() it will - cause buffers to be allocated to allow reading the file to determine if it - is a gzip file. Therefore if gzbuffer() is used, it should be called before - gzdirect(). - - When writing, gzdirect() returns true (1) if transparent writing was - requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: - gzdirect() is not needed when writing. Transparent writing must be - explicitly requested, so the application already knows the answer. When - linking statically, using gzdirect() will include all of the zlib code for - gzip file reading and decompression, which may not be desired.) -*/ - -ZEXTERN int ZEXPORT gzclose OF((gzFile file)); -/* - Flush all pending output for file, if necessary, close file and - deallocate the (de)compression state. Note that once file is closed, you - cannot call gzerror with file, since its structures have been deallocated. - gzclose must not be called more than once on the same file, just as free - must not be called more than once on the same allocation. - - gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a - file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the - last read ended in the middle of a gzip stream, or Z_OK on success. -*/ - -ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); -ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); -/* - Same as gzclose(), but gzclose_r() is only for use when reading, and - gzclose_w() is only for use when writing or appending. The advantage to - using these instead of gzclose() is that they avoid linking in zlib - compression or decompression code that is not used when only reading or only - writing respectively. If gzclose() is used, then both compression and - decompression code will be included the application when linking to a static - zlib library. -*/ - -ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); -/* - Return the error message for the last error which occurred on file. - errnum is set to zlib error number. If an error occurred in the file system - and not in the compression library, errnum is set to Z_ERRNO and the - application may consult errno to get the exact error code. - - The application must not modify the returned string. Future calls to - this function may invalidate the previously returned string. If file is - closed, then the string previously returned by gzerror will no longer be - available. - - gzerror() should be used to distinguish errors from end-of-file for those - functions above that do not distinguish those cases in their return values. -*/ - -ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); -/* - Clear the error and end-of-file flags for file. This is analogous to the - clearerr() function in stdio. This is useful for continuing to read a gzip - file that is being written concurrently. -*/ - -#endif /* !Z_SOLO */ - - /* checksum functions */ - -/* - These functions are not related to compression but are exported - anyway because they might be useful in applications using the compression - library. -*/ - -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); -/* - Update a running Adler-32 checksum with the bytes buf[0..len-1] and - return the updated checksum. An Adler-32 value is in the range of a 32-bit - unsigned integer. If buf is Z_NULL, this function returns the required - initial value for the checksum. - - An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed - much faster. - - Usage example: - - uLong adler = adler32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - adler = adler32(adler, buffer, length); - } - if (adler != original_adler) error(); -*/ - -ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, - z_size_t len)); -/* - Same as adler32(), but with a size_t length. -*/ - -/* -ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, - z_off_t len2)); - - Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 - and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for - each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of - seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note - that the z_off_t type (like off_t) is a signed integer. If len2 is - negative, the result has no meaning or utility. -*/ - -ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); -/* - Update a running CRC-32 with the bytes buf[0..len-1] and return the - updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. - If buf is Z_NULL, this function returns the required initial value for the - crc. Pre- and post-conditioning (one's complement) is performed within this - function so it shouldn't be done by the application. - - Usage example: - - uLong crc = crc32(0L, Z_NULL, 0); - - while (read_buffer(buffer, length) != EOF) { - crc = crc32(crc, buffer, length); - } - if (crc != original_crc) error(); -*/ - -ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, - z_size_t len)); -/* - Same as crc32(), but with a size_t length. -*/ - -/* -ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); - - Combine two CRC-32 check values into one. For two sequences of bytes, - seq1 and seq2 with lengths len1 and len2, CRC-32 check values were - calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 - check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. -*/ - -/* -ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); - - Return the operator corresponding to length len2, to be used with - crc32_combine_op(). -*/ - -ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); -/* - Give the same result as crc32_combine(), using op in place of len2. op is - is generated from len2 by crc32_combine_gen(). This will be faster than - crc32_combine() if the generated op is used more than once. -*/ - - - /* various hacks, don't look :) */ - -/* deflateInit and inflateInit are macros to allow checking the zlib version - * and the compiler's view of z_stream: - */ -ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, - int windowBits, int memLevel, - int strategy, const char *version, - int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, - const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, - unsigned char FAR *window, - const char *version, - int stream_size)); -#ifdef Z_PREFIX_SET -# define z_deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -# define z_inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -# define z_inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) -#else -# define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -# define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -# define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -# define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) -#endif - -#ifndef Z_SOLO - -/* gzgetc() macro and its supporting function and exposed data structure. Note - * that the real internal state is much larger than the exposed structure. - * This abbreviated structure exposes just enough for the gzgetc() macro. The - * user should not mess with these exposed elements, since their names or - * behavior could change in the future, perhaps even capriciously. They can - * only be used by the gzgetc() macro. You have been warned. - */ -struct gzFile_s { - unsigned have; - unsigned char *next; - z_off64_t pos; -}; -ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ -#ifdef Z_PREFIX_SET -# undef z_gzgetc -# define z_gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) -#else -# define gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) -#endif - -/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or - * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if - * both are true, the application gets the *64 functions, and the regular - * functions are changed to 64 bits) -- in case these are set on systems - * without large file support, _LFS64_LARGEFILE must also be true - */ -#ifdef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); - ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); -#endif - -#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) -# ifdef Z_PREFIX_SET -# define z_gzopen z_gzopen64 -# define z_gzseek z_gzseek64 -# define z_gztell z_gztell64 -# define z_gzoffset z_gzoffset64 -# define z_adler32_combine z_adler32_combine64 -# define z_crc32_combine z_crc32_combine64 -# define z_crc32_combine_gen z_crc32_combine_gen64 -# else -# define gzopen gzopen64 -# define gzseek gzseek64 -# define gztell gztell64 -# define gzoffset gzoffset64 -# define adler32_combine adler32_combine64 -# define crc32_combine crc32_combine64 -# define crc32_combine_gen crc32_combine_gen64 -# endif -# ifndef Z_LARGE64 - ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); -# endif -#else - ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); - ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); - ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); - ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); -#endif - -#else /* Z_SOLO */ - - ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); - -#endif /* !Z_SOLO */ - -/* undocumented functions */ -ZEXTERN const char * ZEXPORT zError OF((int)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); -ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); -ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); -ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); -ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp)); -ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); -ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); -#if defined(_WIN32) && !defined(Z_SOLO) -ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, - const char *mode)); -#endif -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, - const char *format, - va_list va)); -# endif -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ZLIB_H */ diff --git a/NorthstarDLL/include/libzip/lib/bz2.lib b/NorthstarDLL/include/libzip/lib/bz2.lib deleted file mode 100644 index 54e3a9aef44b0fa8a79af87ca9d638002cab926c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6224 zcmb_gYiL|W6h3*hF-eo`CfTG93mY0R1{%|3leAXL_Jzi#Nl7;m{Nd)Y8@rNZ<8DHs zrC3Btu{D4Fp$LVdg5a+fp?{1)3Wc`TD#eHoC_zdIKBE5&#B=7{xihnOqP^)}I6HUF zIWynPoX4EI4bKf{Mo;W3dnRl?J9n9V*=u!PcJ12J$*)6Y0MHIldLN*C1)!n@Ah4UM zY79WoZETT(rWU2`R5LNd$bOl?a-~*=Gc>toC^A0Uxi&Q(vRCyLa&@#42 zb=R2c8v%$yvrP3kUJ#D0N2>N?9zA>@V^~{^Q2BoT2(VrYn^i3rvjX7N=BUAU_csiT(C^1)Q zy^x$9n4HNb&ArojB~jX*>6{(BoJmb5J&RIYo4y^9tq`l=P9Gvb|0Xrh4U zJTNmh7E9Bw^crJ?MVvcMSzwKkngWjzY(1%qV?kB~Vm&7gIR z)d&X5PLd@IA#+$dHa?R*VMv+7(ov7cFo&hdOeUQ%#xlouo@;A$^V~K}boWaER>}cd zDgbr|0LH2SZX=xv0$j#^CAQ%jfSziAD@YHpKVJ)Q9(hYhgZO?Hv)(e&wK{;tdVtvw z%CTKS8bn?*_Lq?`sX{f>zy{a|#qb1_LJ3qrIc$P5sDc0lp%S)29c+UwPzxcbhs{s` zg}%oWt?hq&n9B1!{^NQoYs#)l0FomTAS-z$Q4BRs@wAZ?>CR&5RSz`k+me8YbH)|1 zsOJEEyb-9HzBXR>FWtl0vv`c|q4pqRJxdVyyma)-L>WjPx8eFqtWMQXu#S?<+%zxw zo-1vQ$rU?yCMEIAB`mFPQQ13}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yrzex|XcwIaYA1cj5@G;Bp&9ewm~JQunP~&x@C8FWF02D-4$T=qVj6 zM;__A|77f=_wm&ROMg#gpmZ(S6?8l^?szswJTq1zlJ83`J@f^vokJU*ee%A8qzyF| zN;>Ds6{DYkd(M%6U5hBb&&w__pW)JhUpCb3Bps+D1lNE2Tqu@f&3;z<$k()Hs~Agt I18cVCe|!TI*Z=?k diff --git a/NorthstarDLL/include/libzip/share/bzip2/copyright b/NorthstarDLL/include/libzip/share/bzip2/copyright deleted file mode 100644 index 81a37eab7..000000000 --- a/NorthstarDLL/include/libzip/share/bzip2/copyright +++ /dev/null @@ -1,42 +0,0 @@ - --------------------------------------------------------------------------- - -This program, "bzip2", the associated library "libbzip2", and all -documentation, are copyright (C) 1996-2019 Julian R Seward. All -rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product - documentation would be appreciated but is not required. - -3. Altered source versions must be plainly marked as such, and must - not be misrepresented as being the original software. - -4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Julian Seward, jseward@acm.org -bzip2/libbzip2 version 1.0.8 of 13 July 2019 - --------------------------------------------------------------------------- diff --git a/NorthstarDLL/include/libzip/share/bzip2/usage b/NorthstarDLL/include/libzip/share/bzip2/usage deleted file mode 100644 index b2a3e97d5..000000000 --- a/NorthstarDLL/include/libzip/share/bzip2/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package bzip2 is compatible with built-in CMake targets: - - find_package(BZip2 REQUIRED) - target_link_libraries(main PRIVATE BZip2::BZip2) diff --git a/NorthstarDLL/include/libzip/share/bzip2/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/bzip2/vcpkg.spdx.json deleted file mode 100644 index cc51cdba6..000000000 --- a/NorthstarDLL/include/libzip/share/bzip2/vcpkg.spdx.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", - "spdxVersion": "SPDX-2.2", - "dataLicense": "CC0-1.0", - "SPDXID": "SPDXRef-DOCUMENT", - "documentNamespace": "https://spdx.org/spdxdocs/bzip2-x64-windows-1.0.8#3-f705dfa4-60f8-4c9e-a288-4e283dd5bc33", - "name": "bzip2:x64-windows@1.0.8#3 29cfbc197d4db4bb665618ce7fc151833568137d7835176633c5dd5012bbeeef", - "creationInfo": { - "creators": [ - "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" - ], - "created": "2022-11-21T10:26:35Z" - }, - "relationships": [ - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "GENERATES", - "relatedSpdxElement": "SPDXRef-binary" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-0" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-1" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-2" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-3" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-4" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-5" - }, - { - "spdxElementId": "SPDXRef-binary", - "relationshipType": "GENERATED_FROM", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-0", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-1", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-2", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-3", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-4", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-5", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-5", - "relationshipType": "DEPENDENCY_MANIFEST_OF", - "relatedSpdxElement": "SPDXRef-port" - } - ], - "packages": [ - { - "name": "bzip2", - "SPDXID": "SPDXRef-port", - "versionInfo": "1.0.8#3", - "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/bzip2", - "homepage": "https://sourceware.org/bzip2/", - "licenseConcluded": "bzip2-1.0.6", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "description": "bzip2 is a freely available, patent free, high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression.", - "comment": "This is the port (recipe) consumed by vcpkg." - }, - { - "name": "bzip2:x64-windows", - "SPDXID": "SPDXRef-binary", - "versionInfo": "29cfbc197d4db4bb665618ce7fc151833568137d7835176633c5dd5012bbeeef", - "downloadLocation": "NONE", - "licenseConcluded": "bzip2-1.0.6", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "comment": "This is a binary package built by vcpkg." - }, - { - "SPDXID": "SPDXRef-resource-1", - "name": "bzip2-${BZIP2_VERSION}.tar.gz", - "packageFileName": "bzip2-${BZIP2_VERSION}.tar.gz", - "downloadLocation": "https://sourceware.org/pub/bzip2/bzip2-${BZIP2_VERSION}.tar.gz", - "licenseConcluded": "NOASSERTION", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "checksums": [ - { - "algorithm": "SHA512", - "checksumValue": "083f5e675d73f3233c7930ebe20425a533feedeaaa9d8cc86831312a6581cefbe6ed0d08d2fa89be81082f2a5abdabca8b3c080bf97218a1bd59dc118a30b9f3" - } - ] - } - ], - "files": [ - { - "fileName": "./bzip2.pc.in", - "SPDXID": "SPDXRef-file-0", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "ec5bae2705896aa6f2ac5eb2b02c5512568203808c8427484b5eef1da670df91" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./CMakeLists.txt", - "SPDXID": "SPDXRef-file-1", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "4f14b283a0be8ae8ad8a6c6db288ff5ffe3af6d82506fac266532b11ea9a8a33" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./fix-import-export-macros.patch", - "SPDXID": "SPDXRef-file-2", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "38918c1257c884cc5cde39d9f4235d0e71574f20c7e5ec686a506612f647495e" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./portfile.cmake", - "SPDXID": "SPDXRef-file-3", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "ffef2f051e412a3fd1ef78cd18439c113f8ae4d0d49e581f19697704331661de" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./usage", - "SPDXID": "SPDXRef-file-4", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "75d339011fc11a43ee5093142ca1e8cb5e54db2ac93822abc5de694cda5a9881" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg.json", - "SPDXID": "SPDXRef-file-5", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "1e3d45a5e6f560a0c49bfba02296c497b7f8d2d0c86006eca511357efe7b86c8" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - } - ] -} diff --git a/NorthstarDLL/include/libzip/share/bzip2/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/bzip2/vcpkg_abi_info.txt deleted file mode 100644 index 65174d268..000000000 --- a/NorthstarDLL/include/libzip/share/bzip2/vcpkg_abi_info.txt +++ /dev/null @@ -1,21 +0,0 @@ -CMakeLists.txt 4f14b283a0be8ae8ad8a6c6db288ff5ffe3af6d82506fac266532b11ea9a8a33 -bzip2.pc.in ec5bae2705896aa6f2ac5eb2b02c5512568203808c8427484b5eef1da670df91 -cmake 3.24.0 -features core;tool -fix-import-export-macros.patch 38918c1257c884cc5cde39d9f4235d0e71574f20c7e5ec686a506612f647495e -portfile.cmake ffef2f051e412a3fd1ef78cd18439c113f8ae4d0d49e581f19697704331661de -ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 -post_build_checks 2 -powershell 7.3.0 -triplet x64-windows -triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 -usage 75d339011fc11a43ee5093142ca1e8cb5e54db2ac93822abc5de694cda5a9881 -vcpkg-cmake 071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2 -vcpkg-cmake-config 7a89a2c694fe410451262c8f36436ebbcdd0dc5b99f3166c537c5aebdf8623d4 -vcpkg.json 1e3d45a5e6f560a0c49bfba02296c497b7f8d2d0c86006eca511357efe7b86c8 -vcpkg_check_features 3cdc889b7e6965ad5ddab803060aed2019c0177b6f314c7a5a947c01efa4db60 -vcpkg_copy_pdbs d57e4f196c82dc562a9968c6155073094513c31e2de475694143d3aa47954b1c -vcpkg_download_distfile 257c2c17449e740e4553a7adc37fdd80e811045957ff1d86f18c142a290b5865 -vcpkg_extract_source_archive a25e0132b36c30e9675f934042fb1164128864eeefa064ab8eabb1eb347aa381 -vcpkg_extract_source_archive_ex ab9f5bd71a8e1ca4a56d5c09f248c2bc10ff8df3b600c3efb6cca34cba9ec3b7 -vcpkg_fixup_pkgconfig 433d0d235b4e9f6c7bb8744a2f06a9f534b355da67d0d85b7c2daf15c8c77671 diff --git a/NorthstarDLL/include/libzip/share/libzip/copyright b/NorthstarDLL/include/libzip/share/libzip/copyright deleted file mode 100644 index fa7060961..000000000 --- a/NorthstarDLL/include/libzip/share/libzip/copyright +++ /dev/null @@ -1,31 +0,0 @@ -Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner - -The authors can be contacted at - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. The names of the authors may not be used to endorse or promote - products derived from this software without specific prior - written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-config-version.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-config-version.cmake deleted file mode 100644 index 1895c7208..000000000 --- a/NorthstarDLL/include/libzip/share/libzip/libzip-config-version.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# This is a basic version file for the Config-mode of find_package(). -# It is used by write_basic_package_version_file() as input file for configure_file() -# to create a version-file which can be installed along a config.cmake file. -# -# The created file sets PACKAGE_VERSION_EXACT if the current version string and -# the requested version string are exactly the same and it sets -# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. -# The variable CVF_VERSION must be set before calling configure_file(). - -set(PACKAGE_VERSION "1.9.2") - -if (PACKAGE_FIND_VERSION_RANGE) - # Package version must be in the requested version range - if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN) - OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX) - OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX))) - set(PACKAGE_VERSION_COMPATIBLE FALSE) - else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - endif() -else() - if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) - set(PACKAGE_VERSION_COMPATIBLE FALSE) - else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) - set(PACKAGE_VERSION_EXACT TRUE) - endif() - endif() -endif() - - -# if the installed project requested no architecture check, don't perform the check -if("FALSE") - return() -endif() - -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") - return() -endif() - -# check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") - math(EXPR installedBits "8 * 8") - set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") - set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif() diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-config.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-config.cmake deleted file mode 100644 index 7b8b6580c..000000000 --- a/NorthstarDLL/include/libzip/share/libzip/libzip-config.cmake +++ /dev/null @@ -1,47 +0,0 @@ - -####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### -####### Any changes to this file will be overwritten by the next CMake run #### -####### The input file was libzip-config.cmake.in ######## - -get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE) - -macro(set_and_check _var _file) - set(${_var} "${_file}") - if(NOT EXISTS "${_file}") - message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") - endif() -endmacro() - -macro(check_required_components _NAME) - foreach(comp ${${_NAME}_FIND_COMPONENTS}) - if(NOT ${_NAME}_${comp}_FOUND) - if(${_NAME}_FIND_REQUIRED_${comp}) - set(${_NAME}_FOUND FALSE) - endif() - endif() - endforeach() -endmacro() - -#################################################################################### - -# only needed for static library, and doesn't work as-is -include(CMakeFindDependencyMacro) -if(ON) - find_dependency(BZip2) -endif() -if(OFF) - find_dependency(LibLZMA) -endif() -if(OFF) - find_dependency(Zstd) -endif() -if(OFF) - find_dependency(OpenSSL) -endif() -find_dependency(ZLIB) -# how to handle the optional dependencies? -# Provide all our library targets to users. -include("${CMAKE_CURRENT_LIST_DIR}/libzip-targets.cmake") - -check_required_components(libzip) - diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-targets-debug.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-targets-debug.cmake deleted file mode 100644 index e6f881903..000000000 --- a/NorthstarDLL/include/libzip/share/libzip/libzip-targets-debug.cmake +++ /dev/null @@ -1,19 +0,0 @@ -#---------------------------------------------------------------- -# Generated CMake target import file for configuration "Debug". -#---------------------------------------------------------------- - -# Commands may need to know the format version. -set(CMAKE_IMPORT_FILE_VERSION 1) - -# Import target "libzip::zip" for configuration "Debug" -set_property(TARGET libzip::zip APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) -set_target_properties(libzip::zip PROPERTIES - IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/debug/lib/zip.lib" - IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/bin/zip.dll" - ) - -list(APPEND _cmake_import_check_targets libzip::zip ) -list(APPEND _cmake_import_check_files_for_libzip::zip "${_IMPORT_PREFIX}/debug/lib/zip.lib" "${_IMPORT_PREFIX}/debug/bin/zip.dll" ) - -# Commands beyond this point should not need to know the version. -set(CMAKE_IMPORT_FILE_VERSION) diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-targets-release.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-targets-release.cmake deleted file mode 100644 index e4a6ef0a7..000000000 --- a/NorthstarDLL/include/libzip/share/libzip/libzip-targets-release.cmake +++ /dev/null @@ -1,19 +0,0 @@ -#---------------------------------------------------------------- -# Generated CMake target import file for configuration "Release". -#---------------------------------------------------------------- - -# Commands may need to know the format version. -set(CMAKE_IMPORT_FILE_VERSION 1) - -# Import target "libzip::zip" for configuration "Release" -set_property(TARGET libzip::zip APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) -set_target_properties(libzip::zip PROPERTIES - IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/zip.lib" - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/zip.dll" - ) - -list(APPEND _cmake_import_check_targets libzip::zip ) -list(APPEND _cmake_import_check_files_for_libzip::zip "${_IMPORT_PREFIX}/lib/zip.lib" "${_IMPORT_PREFIX}/bin/zip.dll" ) - -# Commands beyond this point should not need to know the version. -set(CMAKE_IMPORT_FILE_VERSION) diff --git a/NorthstarDLL/include/libzip/share/libzip/libzip-targets.cmake b/NorthstarDLL/include/libzip/share/libzip/libzip-targets.cmake deleted file mode 100644 index b878c1d01..000000000 --- a/NorthstarDLL/include/libzip/share/libzip/libzip-targets.cmake +++ /dev/null @@ -1,101 +0,0 @@ -# Generated by CMake - -if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) - message(FATAL_ERROR "CMake >= 2.8.0 required") -endif() -if(CMAKE_VERSION VERSION_LESS "2.8.3") - message(FATAL_ERROR "CMake >= 2.8.3 required") -endif() -cmake_policy(PUSH) -cmake_policy(VERSION 2.8.3...3.22) -#---------------------------------------------------------------- -# Generated CMake target import file. -#---------------------------------------------------------------- - -# Commands may need to know the format version. -set(CMAKE_IMPORT_FILE_VERSION 1) - -# Protect against multiple inclusion, which would fail when already imported targets are added once more. -set(_cmake_targets_defined "") -set(_cmake_targets_not_defined "") -set(_cmake_expected_targets "") -foreach(_cmake_expected_target IN ITEMS libzip::zip) - list(APPEND _cmake_expected_targets "${_cmake_expected_target}") - if(TARGET "${_cmake_expected_target}") - list(APPEND _cmake_targets_defined "${_cmake_expected_target}") - else() - list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") - endif() -endforeach() -unset(_cmake_expected_target) -if(_cmake_targets_defined STREQUAL _cmake_expected_targets) - unset(_cmake_targets_defined) - unset(_cmake_targets_not_defined) - unset(_cmake_expected_targets) - unset(CMAKE_IMPORT_FILE_VERSION) - cmake_policy(POP) - return() -endif() -if(NOT _cmake_targets_defined STREQUAL "") - string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") - string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") - message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") -endif() -unset(_cmake_targets_defined) -unset(_cmake_targets_not_defined) -unset(_cmake_expected_targets) - - -# Compute the installation prefix relative to this file. -get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -if(_IMPORT_PREFIX STREQUAL "/") - set(_IMPORT_PREFIX "") -endif() - -# Create imported target libzip::zip -add_library(libzip::zip SHARED IMPORTED) - -set_target_properties(libzip::zip PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include" -) - -# Load information for each installed configuration. -file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/libzip-targets-*.cmake") -foreach(_cmake_config_file IN LISTS _cmake_config_files) - include("${_cmake_config_file}") -endforeach() -unset(_cmake_config_file) -unset(_cmake_config_files) - -# Cleanup temporary variables. -set(_IMPORT_PREFIX) - -# Loop over all imported files and verify that they actually exist -foreach(_cmake_target IN LISTS _cmake_import_check_targets) - foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") - if(NOT EXISTS "${_cmake_file}") - message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file - \"${_cmake_file}\" -but this file does not exist. Possible reasons include: -* The file was deleted, renamed, or moved to another location. -* An install or uninstall procedure did not complete successfully. -* The installation package was faulty and contained - \"${CMAKE_CURRENT_LIST_FILE}\" -but not all the files it references. -") - endif() - endforeach() - unset(_cmake_file) - unset("_cmake_import_check_files_for_${_cmake_target}") -endforeach() -unset(_cmake_target) -unset(_cmake_import_check_targets) - -# This file does not depend on other imported targets which have -# been exported from the same project but in a separate export set. - -# Commands beyond this point should not need to know the version. -set(CMAKE_IMPORT_FILE_VERSION) -cmake_policy(POP) diff --git a/NorthstarDLL/include/libzip/share/libzip/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/libzip/vcpkg.spdx.json deleted file mode 100644 index 2bba7d4fa..000000000 --- a/NorthstarDLL/include/libzip/share/libzip/vcpkg.spdx.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", - "spdxVersion": "SPDX-2.2", - "dataLicense": "CC0-1.0", - "SPDXID": "SPDXRef-DOCUMENT", - "documentNamespace": "https://spdx.org/spdxdocs/libzip-x64-windows-1.9.2-8db99669-09e3-4718-95fb-5e53a4aedcc9", - "name": "libzip:x64-windows@1.9.2 cc7a2dc90d2cfd63165358b4bef8e374bf8323e218fb1879d49e1b8266df33b0", - "creationInfo": { - "creators": [ - "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" - ], - "created": "2022-11-21T10:27:20Z" - }, - "relationships": [ - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "GENERATES", - "relatedSpdxElement": "SPDXRef-binary" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-0" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-1" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-2" - }, - { - "spdxElementId": "SPDXRef-binary", - "relationshipType": "GENERATED_FROM", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-0", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-1", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-2", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-2", - "relationshipType": "DEPENDENCY_MANIFEST_OF", - "relatedSpdxElement": "SPDXRef-port" - } - ], - "packages": [ - { - "name": "libzip", - "SPDXID": "SPDXRef-port", - "versionInfo": "1.9.2", - "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/libzip", - "homepage": "https://github.com/nih-at/libzip", - "licenseConcluded": "BSD-3-Clause", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "description": "A library for reading, creating, and modifying zip archives.", - "comment": "This is the port (recipe) consumed by vcpkg." - }, - { - "name": "libzip:x64-windows", - "SPDXID": "SPDXRef-binary", - "versionInfo": "cc7a2dc90d2cfd63165358b4bef8e374bf8323e218fb1879d49e1b8266df33b0", - "downloadLocation": "NONE", - "licenseConcluded": "BSD-3-Clause", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "comment": "This is a binary package built by vcpkg." - }, - { - "SPDXID": "SPDXRef-resource-1", - "name": "nih-at/libzip", - "downloadLocation": "git+https://github.com/nih-at/libzip@5532f9baa0c44cc5435ad135686a4ea009075b9a", - "licenseConcluded": "NOASSERTION", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "checksums": [ - { - "algorithm": "SHA512", - "checksumValue": "1105bc48c8a554a7fce84028197427b02ff53508592889b37e81cc419eb208d91112b98df2bf2d6f5629887e4418230ee36e3bf03c9ae39cdc39cfa90e7e3e7f" - } - ] - } - ], - "files": [ - { - "fileName": "./fix-dependency.patch", - "SPDXID": "SPDXRef-file-0", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "a4a25a61584ec286ba202e8ba87b49eb57eaafa71ef4af1de28cb8d39baccb66" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./portfile.cmake", - "SPDXID": "SPDXRef-file-1", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "eb343ec7c73620b6e8dd421381e1d738da55a791202abff6f3cbb4cbae9cd3ba" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg.json", - "SPDXID": "SPDXRef-file-2", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "eec0f9b1b449b5f3c87d39ee719b4baf3c7b8c278406cade284793c0669d1118" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - } - ] -} diff --git a/NorthstarDLL/include/libzip/share/libzip/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/libzip/vcpkg_abi_info.txt deleted file mode 100644 index eadf8fb7c..000000000 --- a/NorthstarDLL/include/libzip/share/libzip/vcpkg_abi_info.txt +++ /dev/null @@ -1,19 +0,0 @@ -bzip2 29cfbc197d4db4bb665618ce7fc151833568137d7835176633c5dd5012bbeeef -cmake 3.24.0 -features bzip2;core;default-aes;wincrypto -fix-dependency.patch a4a25a61584ec286ba202e8ba87b49eb57eaafa71ef4af1de28cb8d39baccb66 -portfile.cmake eb343ec7c73620b6e8dd421381e1d738da55a791202abff6f3cbb4cbae9cd3ba -ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 -post_build_checks 2 -powershell 7.3.0 -triplet x64-windows -triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 -vcpkg-cmake 071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2 -vcpkg-cmake-config 7a89a2c694fe410451262c8f36436ebbcdd0dc5b99f3166c537c5aebdf8623d4 -vcpkg.json eec0f9b1b449b5f3c87d39ee719b4baf3c7b8c278406cade284793c0669d1118 -vcpkg_check_features 3cdc889b7e6965ad5ddab803060aed2019c0177b6f314c7a5a947c01efa4db60 -vcpkg_copy_pdbs d57e4f196c82dc562a9968c6155073094513c31e2de475694143d3aa47954b1c -vcpkg_fixup_pkgconfig 433d0d235b4e9f6c7bb8744a2f06a9f534b355da67d0d85b7c2daf15c8c77671 -vcpkg_from_git 42a2f33208e157d5332b7ce93a28fc3948d4c0be78cacc8013a5d6ce06eaede1 -vcpkg_from_github b743742296a114ea1b18ae99672e02f142c4eb2bef7f57d36c038bedbfb0502f -zlib cfba80992a665d41aa217b6bd51c1720ddab0b5bcdc338feae38235d27cdc83c diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/copyright b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/copyright deleted file mode 100644 index 2e4eac826..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/copyright +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -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. diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg-port-config.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg-port-config.cmake deleted file mode 100644 index 980d41131..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg-port-config.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_config_fixup.cmake") diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg.spdx.json deleted file mode 100644 index c4d5660ea..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg.spdx.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", - "spdxVersion": "SPDX-2.2", - "dataLicense": "CC0-1.0", - "SPDXID": "SPDXRef-DOCUMENT", - "documentNamespace": "https://spdx.org/spdxdocs/vcpkg-cmake-config-x64-windows-2022-02-06#1-fbb47e83-e270-46bd-b2f3-ebbf3b1c16e5", - "name": "vcpkg-cmake-config:x64-windows@2022-02-06#1 7a89a2c694fe410451262c8f36436ebbcdd0dc5b99f3166c537c5aebdf8623d4", - "creationInfo": { - "creators": [ - "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" - ], - "created": "2022-11-18T16:00:08Z" - }, - "relationships": [ - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "GENERATES", - "relatedSpdxElement": "SPDXRef-binary" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-0" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-1" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-2" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-3" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-4" - }, - { - "spdxElementId": "SPDXRef-binary", - "relationshipType": "GENERATED_FROM", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-0", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-1", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-2", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-3", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-3", - "relationshipType": "DEPENDENCY_MANIFEST_OF", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-4", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - } - ], - "packages": [ - { - "name": "vcpkg-cmake-config", - "SPDXID": "SPDXRef-port", - "versionInfo": "2022-02-06#1", - "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/vcpkg-cmake-config", - "licenseConcluded": "MIT", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "comment": "This is the port (recipe) consumed by vcpkg." - }, - { - "name": "vcpkg-cmake-config:x64-windows", - "SPDXID": "SPDXRef-binary", - "versionInfo": "7a89a2c694fe410451262c8f36436ebbcdd0dc5b99f3166c537c5aebdf8623d4", - "downloadLocation": "NONE", - "licenseConcluded": "MIT", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "comment": "This is a binary package built by vcpkg." - } - ], - "files": [ - { - "fileName": "./copyright", - "SPDXID": "SPDXRef-file-0", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "04b60f99a43bfd7fefdc8364b24aac704a2160cef969b75ba6a38b62dc4c4b70" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./portfile.cmake", - "SPDXID": "SPDXRef-file-1", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "832b34e63f5af41ad1b2e4aa79c5bfa507a005b120b51548e674accc706837d7" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg-port-config.cmake", - "SPDXID": "SPDXRef-file-2", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "72bc3093337e633bdd19fe5d4dd1f38ca1918def49608d676a9c98c686d38b1e" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg.json", - "SPDXID": "SPDXRef-file-3", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "4ffbabc2feab69abd21267f57669ef5e404bcbfa5ab6d93234374d98f5ff1864" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg_cmake_config_fixup.cmake", - "SPDXID": "SPDXRef-file-4", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "f92905382d90e37fa2addd96becce31f5075175196b117de6dd997a4ac1d6d06" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - } - ] -} diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_abi_info.txt deleted file mode 100644 index 03361725e..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_abi_info.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake 3.24.0 -copyright 04b60f99a43bfd7fefdc8364b24aac704a2160cef969b75ba6a38b62dc4c4b70 -features core -portfile.cmake 832b34e63f5af41ad1b2e4aa79c5bfa507a005b120b51548e674accc706837d7 -ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 -post_build_checks 2 -powershell 7.3.0 -triplet x64-windows -triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 -vcpkg-port-config.cmake 72bc3093337e633bdd19fe5d4dd1f38ca1918def49608d676a9c98c686d38b1e -vcpkg.json 4ffbabc2feab69abd21267f57669ef5e404bcbfa5ab6d93234374d98f5ff1864 -vcpkg_cmake_config_fixup.cmake f92905382d90e37fa2addd96becce31f5075175196b117de6dd997a4ac1d6d06 -vcpkg_list f5de3ebcbc40a4db90622ade9aca918e2cf404dc0d91342fcde457d730e6fa29 diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake deleted file mode 100644 index 368e5809a..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ /dev/null @@ -1,258 +0,0 @@ -include_guard(GLOBAL) - -function(vcpkg_cmake_config_fixup) - cmake_parse_arguments(PARSE_ARGV 0 "arg" "DO_NOT_DELETE_PARENT_CONFIG_PATH;NO_PREFIX_CORRECTION" "PACKAGE_NAME;CONFIG_PATH;TOOLS_PATH" "") - - if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "vcpkg_cmake_config_fixup was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") - endif() - if(NOT arg_PACKAGE_NAME) - set(arg_PACKAGE_NAME "${PORT}") - endif() - if(NOT arg_CONFIG_PATH) - set(arg_CONFIG_PATH "share/${arg_PACKAGE_NAME}") - endif() - if(NOT arg_TOOLS_PATH) - set(arg_TOOLS_PATH "tools/${PORT}") - endif() - set(target_path "share/${arg_PACKAGE_NAME}") - - string(REPLACE "." "\\." EXECUTABLE_SUFFIX "${VCPKG_TARGET_EXECUTABLE_SUFFIX}") - - set(debug_share "${CURRENT_PACKAGES_DIR}/debug/${target_path}") - set(release_share "${CURRENT_PACKAGES_DIR}/${target_path}") - - if(NOT arg_CONFIG_PATH STREQUAL "share/${arg_PACKAGE_NAME}") - if(arg_CONFIG_PATH STREQUAL "share") - set(arg_CONFIG_PATH z_vcpkg_share) - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/${arg_CONFIG_PATH}") - file(RENAME "${CURRENT_PACKAGES_DIR}/share" "${CURRENT_PACKAGES_DIR}/${arg_CONFIG_PATH}") - endif() - - set(debug_config "${CURRENT_PACKAGES_DIR}/debug/${arg_CONFIG_PATH}") - set(release_config "${CURRENT_PACKAGES_DIR}/${arg_CONFIG_PATH}") - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(NOT EXISTS "${debug_config}") - message(FATAL_ERROR "'${debug_config}' does not exist.") - endif() - - # This roundabout handling enables CONFIG_PATH = share - file(MAKE_DIRECTORY "${debug_share}") - file(GLOB files "${debug_config}/*") - file(COPY ${files} DESTINATION "${debug_share}") - file(REMOVE_RECURSE "${debug_config}") - endif() - - file(GLOB files "${release_config}/*") - file(COPY ${files} DESTINATION "${release_share}") - file(REMOVE_RECURSE "${release_config}") - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - get_filename_component(debug_config_dir_name "${debug_config}" NAME) - string(TOLOWER "${debug_config_dir_name}" debug_config_dir_name) - if(debug_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(REMOVE_RECURSE "${debug_config}") - else() - get_filename_component(debug_config_parent_dir "${debug_config}" DIRECTORY) - get_filename_component(debug_config_dir_name "${debug_config_parent_dir}" NAME) - string(TOLOWER "${debug_config_dir_name}" debug_config_dir_name) - if(debug_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(REMOVE_RECURSE "${debug_config_parent_dir}") - endif() - endif() - endif() - - get_filename_component(release_config_dir_name "${release_config}" NAME) - string(TOLOWER "${release_config_dir_name}" release_config_dir_name) - if(release_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(REMOVE_RECURSE "${release_config}") - else() - get_filename_component(release_config_parent_dir "${release_config}" DIRECTORY) - get_filename_component(release_config_dir_name "${release_config_parent_dir}" NAME) - string(TOLOWER "${release_config_dir_name}" release_config_dir_name) - if(release_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(REMOVE_RECURSE "${release_config_parent_dir}") - endif() - endif() - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(NOT EXISTS "${debug_share}") - message(FATAL_ERROR "'${debug_share}' does not exist.") - endif() - endif() - - file(GLOB_RECURSE release_targets - "${release_share}/*-release.cmake" - ) - foreach(release_target IN LISTS release_targets) - file(READ "${release_target}" contents) - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" contents "${contents}") - string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" contents "${contents}") - file(WRITE "${release_target}" "${contents}") - endforeach() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(GLOB_RECURSE debug_targets - "${debug_share}/*-debug.cmake" - ) - foreach(debug_target IN LISTS debug_targets) - file(RELATIVE_PATH debug_target_rel "${debug_share}" "${debug_target}") - - file(READ "${debug_target}" contents) - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" contents "${contents}") - string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \";]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" contents "${contents}") - string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" contents "${contents}") - string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" contents "${contents}") - file(WRITE "${release_share}/${debug_target_rel}" "${contents}") - - file(REMOVE "${debug_target}") - endforeach() - endif() - - #Fix ${_IMPORT_PREFIX} and absolute paths in cmake generated targets and configs; - #Since those can be renamed we have to check in every *.cmake, but only once. - file(GLOB_RECURSE main_cmakes "${release_share}/*.cmake") - if(NOT DEFINED Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP) - vcpkg_list(SET Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP) - endif() - foreach(already_fixed_up IN LISTS Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP) - vcpkg_list(REMOVE_ITEM main_cmakes "${already_fixed_up}") - endforeach() - vcpkg_list(APPEND Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP ${main_cmakes}) - set(Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP "${Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP}" CACHE INTERNAL "") - - foreach(main_cmake IN LISTS main_cmakes) - file(READ "${main_cmake}" contents) - # Note: I think the following comment is no longer true, since we now require the path to be `share/blah` - # however, I don't know it for sure. - # - nimazzuc - - #This correction is not correct for all cases. To make it correct for all cases it needs to consider - #original folder deepness to CURRENT_PACKAGES_DIR in comparison to the moved to folder deepness which - #is always at least (>=) 2, e.g. share/${PORT}. Currently the code assumes it is always 2 although - #this requirement is only true for the *Config.cmake. The targets are not required to be in the same - #folder as the *Config.cmake! - if(NOT arg_NO_PREFIX_CORRECTION) - string(REGEX REPLACE -[[get_filename_component\(_IMPORT_PREFIX "\${CMAKE_CURRENT_LIST_FILE}" PATH\)( -get_filename_component\(_IMPORT_PREFIX "\${_IMPORT_PREFIX}" PATH\))*]] -[[get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] - contents "${contents}") # see #1044 for details why this replacement is necessary. See #4782 why it must be a regex. - string(REGEX REPLACE -[[get_filename_component\(PACKAGE_PREFIX_DIR "\${CMAKE_CURRENT_LIST_DIR}/\.\./(\.\./)*" ABSOLUTE\)]] -[[get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)]] - contents "${contents}") - string(REGEX REPLACE -[[get_filename_component\(PACKAGE_PREFIX_DIR "\${CMAKE_CURRENT_LIST_DIR}/\.\.((\\|/)\.\.)*" ABSOLUTE\)]] -[[get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)]] - contents "${contents}") # This is a meson-related workaround, see https://github.com/mesonbuild/meson/issues/6955 - endif() - - # Merge release and debug configurations of target property INTERFACE_LINK_LIBRARIES. - string(REPLACE "${release_share}/" "${debug_share}/" debug_cmake "${main_cmake}") - if(DEFINED VCPKG_BUILD_TYPE) - # Skip. Warning: A release-only port in a dual-config installation - # may pull release dependencies into the debug configuration. - elseif(NOT contents MATCHES "INTERFACE_LINK_LIBRARIES") - # Skip. No relevant properties. - elseif(NOT contents MATCHES "# Generated CMake target import file\\.") - # Skip. No safe assumptions about a matching debug import file. - elseif(NOT EXISTS "${debug_cmake}") - message(SEND_ERROR "Did not find a debug import file matching '${main_cmake}'") - else() - file(READ "${debug_cmake}" debug_contents) - while(contents MATCHES "set_target_properties\\(([^ \$]*) PROPERTIES[^)]*\\)") - set(matched_command "${CMAKE_MATCH_0}") - string(REPLACE "+" "\\+" target "${CMAKE_MATCH_1}") - if(NOT debug_contents MATCHES "set_target_properties\\(${target} PROPERTIES[^)]*\\)") - message(SEND_ERROR "Did not find a debug configuration for target '${target}'.") - endif() - set(debug_command "${CMAKE_MATCH_0}") - string(REGEX MATCH " INTERFACE_LINK_LIBRARIES \"([^\"]*)\"" release_line "${matched_command}") - set(release_libs "${CMAKE_MATCH_1}") - string(REGEX MATCH " INTERFACE_LINK_LIBRARIES \"([^\"]*)\"" debug_line "${debug_command}") - set(debug_libs "${CMAKE_MATCH_1}") - z_vcpkg_cmake_config_fixup_merge(merged_libs release_libs debug_libs) - string(REPLACE "${release_line}" " INTERFACE_LINK_LIBRARIES \"${merged_libs}\"" updated_command "${matched_command}") - string(REPLACE "set_target_properties" "set_target_properties::done" updated_command "${updated_command}") # Prevend 2nd match - string(REPLACE "${matched_command}" "${updated_command}" contents "${contents}") - endwhile() - string(REPLACE "set_target_properties::done" "set_target_properties" contents "${contents}") # Restore original command - endif() - - #Fix absolute paths to installed dir with ones relative to ${CMAKE_CURRENT_LIST_DIR} - #This happens if vcpkg built libraries are directly linked to a target instead of using - #an imported target. - string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") - file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" cmake_current_packages_dir) - string(REPLACE "${cmake_current_packages_dir}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") - # If ${VCPKG_IMPORT_PREFIX} was actually used, inject a definition of it: - string(FIND "${contents}" [[${VCPKG_IMPORT_PREFIX}]] index) - if (NOT index STREQUAL "-1") - get_filename_component(main_cmake_dir "${main_cmake}" DIRECTORY) - # Calculate relative to be a sequence of "../" - file(RELATIVE_PATH relative "${main_cmake_dir}" "${cmake_current_packages_dir}") - string(PREPEND contents "get_filename_component(VCPKG_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}\/${relative}\" ABSOLUTE)\n") - endif() - - file(WRITE "${main_cmake}" "${contents}") - endforeach() - - file(GLOB_RECURSE unused_files - "${debug_share}/*[Tt]argets.cmake" - "${debug_share}/*[Cc]onfig.cmake" - "${debug_share}/*[Cc]onfigVersion.cmake" - "${debug_share}/*[Cc]onfig-version.cmake" - ) - foreach(unused_file IN LISTS unused_files) - file(REMOVE "${unused_file}") - endforeach() - - # Remove /debug// if it's empty. - file(GLOB_RECURSE remaining_files "${debug_share}/*") - if(remaining_files STREQUAL "") - file(REMOVE_RECURSE "${debug_share}") - endif() - - # Remove /debug/share/ if it's empty. - file(GLOB_RECURSE remaining_files "${CURRENT_PACKAGES_DIR}/debug/share/*") - if(remaining_files STREQUAL "") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") - endif() -endfunction() - -# Merges link interface library lists for release and debug -# into a single expression which use generator expression as necessary. -function(z_vcpkg_cmake_config_fixup_merge out_var release_var debug_var) - set(release_libs "VCPKG;${${release_var}}") - string(REGEX REPLACE ";optimized;([^;]*)" ";\\1" release_libs "${release_libs}") - string(REGEX REPLACE ";debug;([^;]*)" ";" release_libs "${release_libs}") - list(REMOVE_AT release_libs 0) - list(FILTER release_libs EXCLUDE REGEX [[^\\[$]<\\[$]:]]) - list(TRANSFORM release_libs REPLACE [[^\\[$]<\\[$]>:(.*)>$]] "\\1") - - set(debug_libs "VCPKG;${${debug_var}}") - string(REGEX REPLACE ";optimized;([^;]*)" ";" debug_libs "${debug_libs}") - string(REGEX REPLACE ";debug;([^;]*)" ";\\1" debug_libs "${debug_libs}") - list(REMOVE_AT debug_libs 0) - list(FILTER debug_libs EXCLUDE REGEX [[^\\[$]<\\[$]>:]]) - list(TRANSFORM debug_libs REPLACE [[^\\[$]<\\[$]:(.*)>$]] "\\1") - - set(merged_libs "") - foreach(release_lib debug_lib IN ZIP_LISTS release_libs debug_libs) - if(release_lib STREQUAL debug_lib) - list(APPEND merged_libs "${release_lib}") - else() - if(release_lib) - list(APPEND merged_libs "\\\$<\\\$>:${release_lib}>") - endif() - if(debug_lib) - list(APPEND merged_libs "\\\$<\\\$:${debug_lib}>") - endif() - endif() - endforeach() - set("${out_var}" "${merged_libs}" PARENT_SCOPE) -endfunction() diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/copyright b/NorthstarDLL/include/libzip/share/vcpkg-cmake/copyright deleted file mode 100644 index 2e4eac826..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake/copyright +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -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. diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg-port-config.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg-port-config.cmake deleted file mode 100644 index f2a973d4e..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg-port-config.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_configure.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_build.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_install.cmake") diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg.spdx.json deleted file mode 100644 index 96cfe34ab..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg.spdx.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", - "spdxVersion": "SPDX-2.2", - "dataLicense": "CC0-1.0", - "SPDXID": "SPDXRef-DOCUMENT", - "documentNamespace": "https://spdx.org/spdxdocs/vcpkg-cmake-x64-windows-2022-10-30-977ee841-b481-4659-b110-cb500e85eb35", - "name": "vcpkg-cmake:x64-windows@2022-10-30 071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2", - "creationInfo": { - "creators": [ - "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" - ], - "created": "2022-11-18T16:00:07Z" - }, - "relationships": [ - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "GENERATES", - "relatedSpdxElement": "SPDXRef-binary" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-0" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-1" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-2" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-3" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-4" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-5" - }, - { - "spdxElementId": "SPDXRef-binary", - "relationshipType": "GENERATED_FROM", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-0", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-1", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-2", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-2", - "relationshipType": "DEPENDENCY_MANIFEST_OF", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-3", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-4", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-5", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - } - ], - "packages": [ - { - "name": "vcpkg-cmake", - "SPDXID": "SPDXRef-port", - "versionInfo": "2022-10-30", - "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/vcpkg-cmake", - "licenseConcluded": "MIT", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "comment": "This is the port (recipe) consumed by vcpkg." - }, - { - "name": "vcpkg-cmake:x64-windows", - "SPDXID": "SPDXRef-binary", - "versionInfo": "071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2", - "downloadLocation": "NONE", - "licenseConcluded": "MIT", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "comment": "This is a binary package built by vcpkg." - } - ], - "files": [ - { - "fileName": "./portfile.cmake", - "SPDXID": "SPDXRef-file-0", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "a711531b7f13b7da16fa1f25d7c5737a423d4a126465dc9e6689a0f043fcc1aa" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg-port-config.cmake", - "SPDXID": "SPDXRef-file-1", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "f0a30f77c8f5e3ac40436fe2518a61ad067f2955c7ef3be6d6a0ca4b81cd2a45" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg.json", - "SPDXID": "SPDXRef-file-2", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "0cb2343f8550250b0ce0c48e9d9b5f178b73de14dcc18ad5e1c0a9b390ff4046" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg_cmake_build.cmake", - "SPDXID": "SPDXRef-file-3", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "6d1c27080fe3e768b5e7b968d6a28a37db154ebcb214297de25f10b6713511e1" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg_cmake_configure.cmake", - "SPDXID": "SPDXRef-file-4", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "7deaf313e87fb697724d0b0297dae9570ea62aad90d713a2ad000f765888cbdf" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg_cmake_install.cmake", - "SPDXID": "SPDXRef-file-5", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "3ae7886dc8434fac6f1e61190cc355fdec5fbd4f60758e2de20423cf49c91369" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - } - ] -} diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_abi_info.txt deleted file mode 100644 index 44a72672a..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_abi_info.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake 3.24.0 -features core -portfile.cmake a711531b7f13b7da16fa1f25d7c5737a423d4a126465dc9e6689a0f043fcc1aa -ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 -post_build_checks 2 -powershell 7.3.0 -triplet x64-windows -triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 -vcpkg-port-config.cmake f0a30f77c8f5e3ac40436fe2518a61ad067f2955c7ef3be6d6a0ca4b81cd2a45 -vcpkg.json 0cb2343f8550250b0ce0c48e9d9b5f178b73de14dcc18ad5e1c0a9b390ff4046 -vcpkg_add_to_path 5f5ae75cf37b2a58d1a8561ca96496b64cd91ec9a0afab0b976c3e5d59030bfe -vcpkg_cmake_build.cmake 6d1c27080fe3e768b5e7b968d6a28a37db154ebcb214297de25f10b6713511e1 -vcpkg_cmake_configure.cmake 7deaf313e87fb697724d0b0297dae9570ea62aad90d713a2ad000f765888cbdf -vcpkg_cmake_install.cmake 3ae7886dc8434fac6f1e61190cc355fdec5fbd4f60758e2de20423cf49c91369 -vcpkg_configure_cmake d502a617f32d9da6020e15f2ecd06237125fb082b11c16127bd925cd820e3d3a -vcpkg_execute_build_process 1b4fa8be39276dbf7d6d343e1dfc9aa25c0fc4cd35348d5e4c2cca174eb1de59 -vcpkg_execute_required_process 975eab651b1f156e5550defb3abad898ff8159b57a0e0562d3ac3c959043476d -vcpkg_find_acquire_program 6ec553a41c83b89035d8649f06162e79bc0e6e6f49d8a6d05fdea67ccfdb6541 -vcpkg_list f5de3ebcbc40a4db90622ade9aca918e2cf404dc0d91342fcde457d730e6fa29 diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_build.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_build.cmake deleted file mode 100644 index 47933b3fe..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_build.cmake +++ /dev/null @@ -1,91 +0,0 @@ -include_guard(GLOBAL) - -function(vcpkg_cmake_build) - cmake_parse_arguments(PARSE_ARGV 0 "arg" "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "TARGET;LOGFILE_BASE" "") - - if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "vcpkg_cmake_build was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") - endif() - if(NOT DEFINED arg_LOGFILE_BASE) - set(arg_LOGFILE_BASE "build") - endif() - vcpkg_list(SET build_param) - vcpkg_list(SET parallel_param) - vcpkg_list(SET no_parallel_param) - - if("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "Ninja") - vcpkg_list(SET build_param "-v") # verbose output - vcpkg_list(SET parallel_param "-j${VCPKG_CONCURRENCY}") - vcpkg_list(SET no_parallel_param "-j1") - elseif("${Z_VCPKG_CMAKE_GENERATOR}" MATCHES "^Visual Studio") - vcpkg_list(SET build_param - "/p:VCPkgLocalAppDataDisabled=true" - "/p:UseIntelMKL=No" - ) - vcpkg_list(SET parallel_param "/m") - elseif("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "NMake Makefiles") - # No options are currently added for nmake builds - elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Unix Makefiles") - vcpkg_list(SET build_param "VERBOSE=1") - vcpkg_list(SET parallel_param "-j${VCPKG_CONCURRENCY}") - vcpkg_list(SET no_parallel_param "") - elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Xcode") - vcpkg_list(SET parallel_param -jobs "${VCPKG_CONCURRENCY}") - vcpkg_list(SET no_parallel_param -jobs 1) - else() - message(WARNING "Unrecognized GENERATOR setting from vcpkg_cmake_configure().") - endif() - - vcpkg_list(SET target_param) - if(arg_TARGET) - vcpkg_list(SET target_param "--target" "${arg_TARGET}") - endif() - - foreach(build_type IN ITEMS debug release) - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "${build_type}") - if("${build_type}" STREQUAL "debug") - set(short_build_type "dbg") - set(config "Debug") - else() - set(short_build_type "rel") - set(config "Release") - endif() - - message(STATUS "Building ${TARGET_TRIPLET}-${short_build_type}") - - if(arg_ADD_BIN_TO_PATH) - vcpkg_backup_env_variables(VARS PATH) - if("${build_type}" STREQUAL "debug") - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") - else() - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") - endif() - endif() - - if(arg_DISABLE_PARALLEL) - vcpkg_execute_build_process( - COMMAND - "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} - -- ${build_param} ${no_parallel_param} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_build_type}" - LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_build_type}" - ) - else() - vcpkg_execute_build_process( - COMMAND - "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} - -- ${build_param} ${parallel_param} - NO_PARALLEL_COMMAND - "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} - -- ${build_param} ${no_parallel_param} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_build_type}" - LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_build_type}" - ) - endif() - - if(arg_ADD_BIN_TO_PATH) - vcpkg_restore_env_variables(VARS PATH) - endif() - endif() - endforeach() -endfunction() diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_configure.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_configure.cmake deleted file mode 100644 index 832bbf700..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ /dev/null @@ -1,320 +0,0 @@ -include_guard(GLOBAL) - -macro(z_vcpkg_cmake_configure_both_set_or_unset var1 var2) - if(DEFINED ${var1} AND NOT DEFINED ${var2}) - message(FATAL_ERROR "If ${var1} is set, then ${var2} must be set.") - elseif(NOT DEFINED ${var1} AND DEFINED ${var2}) - message(FATAL_ERROR "If ${var2} is set, then ${var1} must be set.") - endif() -endmacro() - -function(vcpkg_cmake_configure) - cmake_parse_arguments(PARSE_ARGV 0 "arg" - "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;WINDOWS_USE_MSBUILD;NO_CHARSET_FLAG;Z_CMAKE_GET_VARS_USAGE" - "SOURCE_PATH;GENERATOR;LOGFILE_BASE" - "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;MAYBE_UNUSED_VARIABLES" - ) - - if(NOT arg_Z_CMAKE_GET_VARS_USAGE AND DEFINED CACHE{Z_VCPKG_CMAKE_GENERATOR}) - message(WARNING "${CMAKE_CURRENT_FUNCTION} already called; this function should only be called once.") - endif() - if(arg_PREFER_NINJA) - message(WARNING "PREFER_NINJA has been deprecated in ${CMAKE_CURRENT_FUNCTION}. Please remove it from the portfile!") - endif() - - if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") - endif() - - if(NOT DEFINED arg_SOURCE_PATH) - message(FATAL_ERROR "SOURCE_PATH must be set") - endif() - if(NOT DEFINED arg_LOGFILE_BASE) - set(arg_LOGFILE_BASE "config-${TARGET_TRIPLET}") - endif() - - set(manually_specified_variables "") - - if(arg_Z_CMAKE_GET_VARS_USAGE) - set(configuring_message "Getting CMake variables for ${TARGET_TRIPLET}") - else() - set(configuring_message "Configuring ${TARGET_TRIPLET}") - - foreach(option IN LISTS arg_OPTIONS arg_OPTIONS_RELEASE arg_OPTIONS_DEBUG) - if("${option}" MATCHES "^-D([^:=]*)[:=]") - vcpkg_list(APPEND manually_specified_variables "${CMAKE_MATCH_1}") - endif() - endforeach() - vcpkg_list(REMOVE_DUPLICATES manually_specified_variables) - foreach(maybe_unused_var IN LISTS arg_MAYBE_UNUSED_VARIABLES) - vcpkg_list(REMOVE_ITEM manually_specified_variables "${maybe_unused_var}") - endforeach() - debug_message("manually specified variables: ${manually_specified_variables}") - endif() - - if(CMAKE_HOST_WIN32) - if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) - set(host_architecture "$ENV{PROCESSOR_ARCHITEW6432}") - else() - set(host_architecture "$ENV{PROCESSOR_ARCHITECTURE}") - endif() - endif() - - set(ninja_host ON) # Ninja availability - if(host_architecture STREQUAL "x86" OR DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES}) - # Prebuilt ninja binaries are only provided for x64 hosts - find_program(NINJA NAMES ninja ninja-build) - if(NOT NINJA) - set(ninja_host OFF) - set(arg_DISABLE_PARALLEL_CONFIGURE ON) - set(arg_WINDOWS_USE_MSBUILD ON) - endif() - endif() - - set(generator "") - set(architecture_options "") - if(arg_WINDOWS_USE_MSBUILD AND VCPKG_HOST_IS_WINDOWS AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - z_vcpkg_get_visual_studio_generator(OUT_GENERATOR generator OUT_ARCH arch) - vcpkg_list(APPEND architecture_options "-A${arch}") - if(DEFINED VCPKG_PLATFORM_TOOLSET) - vcpkg_list(APPEND arg_OPTIONS "-T${VCPKG_PLATFORM_TOOLSET}") - endif() - if(NOT generator) - message(FATAL_ERROR "Unable to determine appropriate Visual Studio generator for triplet ${TARGET_TRIPLET}: - ENV{VisualStudioVersion} : $ENV{VisualStudioVersion} - VCPKG_TARGET_ARCHITECTURE: ${VCPKG_TARGET_ARCHITECTURE}") - endif() - elseif(DEFINED arg_GENERATOR) - set(generator "${arg_GENERATOR}") - elseif(ninja_host) - set(generator "Ninja") - elseif(NOT VCPKG_HOST_IS_WINDOWS) - set(generator "Unix Makefiles") - endif() - - if(NOT generator) - if(NOT VCPKG_CMAKE_SYSTEM_NAME) - set(VCPKG_CMAKE_SYSTEM_NAME "Windows") - endif() - message(FATAL_ERROR "Unable to determine appropriate generator for: " - "${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}") - endif() - - if(generator STREQUAL "Ninja") - vcpkg_find_acquire_program(NINJA) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") - # If we use Ninja, it must be on PATH for CMake's ExternalProject, - # cf. https://gitlab.kitware.com/cmake/cmake/-/issues/23355. - get_filename_component(ninja_path "${NINJA}" DIRECTORY) - vcpkg_add_to_path("${ninja_path}") - endif() - - set(build_dir_release "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - set(build_dir_debug "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - file(REMOVE_RECURSE - "${build_dir_release}" - "${build_dir_debug}") - file(MAKE_DIRECTORY "${build_dir_release}") - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(MAKE_DIRECTORY "${build_dir_debug}") - endif() - - if(DEFINED VCPKG_CMAKE_SYSTEM_NAME) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") - if(VCPKG_TARGET_IS_UWP AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) - set(VCPKG_CMAKE_SYSTEM_VERSION 10.0) - elseif(VCPKG_TARGET_IS_ANDROID AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) - set(VCPKG_CMAKE_SYSTEM_VERSION 21) - endif() - endif() - - if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") - endif() - - if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - vcpkg_list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=ON") - elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - vcpkg_list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=OFF") - else() - message(FATAL_ERROR - "Invalid setting for VCPKG_LIBRARY_LINKAGE: \"${VCPKG_LIBRARY_LINKAGE}\". " - "It must be \"static\" or \"dynamic\"") - endif() - - z_vcpkg_cmake_configure_both_set_or_unset(VCPKG_CXX_FLAGS_DEBUG VCPKG_C_FLAGS_DEBUG) - z_vcpkg_cmake_configure_both_set_or_unset(VCPKG_CXX_FLAGS_RELEASE VCPKG_C_FLAGS_RELEASE) - z_vcpkg_cmake_configure_both_set_or_unset(VCPKG_CXX_FLAGS VCPKG_C_FLAGS) - - set(VCPKG_SET_CHARSET_FLAG ON) - if(arg_NO_CHARSET_FLAG) - set(VCPKG_SET_CHARSET_FLAG OFF) - endif() - - if(NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE) - z_vcpkg_select_default_vcpkg_chainload_toolchain() - endif() - - list(JOIN VCPKG_TARGET_ARCHITECTURE "\;" target_architecture_string) - vcpkg_list(APPEND arg_OPTIONS - "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" - "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" - "-DVCPKG_SET_CHARSET_FLAG=${VCPKG_SET_CHARSET_FLAG}" - "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}" - "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" - "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" - "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" - "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" - "-DCMAKE_VERBOSE_MAKEFILE=ON" - "-DVCPKG_APPLOCAL_DEPS=OFF" - "-DCMAKE_TOOLCHAIN_FILE=${SCRIPTS}/buildsystems/vcpkg.cmake" - "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" - "-DVCPKG_CXX_FLAGS=${VCPKG_CXX_FLAGS}" - "-DVCPKG_CXX_FLAGS_RELEASE=${VCPKG_CXX_FLAGS_RELEASE}" - "-DVCPKG_CXX_FLAGS_DEBUG=${VCPKG_CXX_FLAGS_DEBUG}" - "-DVCPKG_C_FLAGS=${VCPKG_C_FLAGS}" - "-DVCPKG_C_FLAGS_RELEASE=${VCPKG_C_FLAGS_RELEASE}" - "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" - "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" - "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" - "-DVCPKG_LINKER_FLAGS_RELEASE=${VCPKG_LINKER_FLAGS_RELEASE}" - "-DVCPKG_LINKER_FLAGS_DEBUG=${VCPKG_LINKER_FLAGS_DEBUG}" - "-DVCPKG_TARGET_ARCHITECTURE=${target_architecture_string}" - "-DCMAKE_INSTALL_LIBDIR:STRING=lib" - "-DCMAKE_INSTALL_BINDIR:STRING=bin" - "-D_VCPKG_ROOT_DIR=${VCPKG_ROOT_DIR}" - "-D_VCPKG_INSTALLED_DIR=${_VCPKG_INSTALLED_DIR}" - "-DVCPKG_MANIFEST_INSTALL=OFF" - "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" - ) - - # Sets configuration variables for macOS builds - foreach(config_var IN ITEMS INSTALL_NAME_DIR OSX_DEPLOYMENT_TARGET OSX_SYSROOT OSX_ARCHITECTURES) - if(DEFINED VCPKG_${config_var}) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_${config_var}=${VCPKG_${config_var}}") - endif() - endforeach() - - # Allow overrides / additional configuration variables from triplets - if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS) - vcpkg_list(APPEND arg_OPTIONS ${VCPKG_CMAKE_CONFIGURE_OPTIONS}) - endif() - if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE) - vcpkg_list(APPEND arg_OPTIONS_RELEASE ${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE}) - endif() - if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG) - vcpkg_list(APPEND arg_OPTIONS_DEBUG ${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG}) - endif() - - vcpkg_list(SET rel_command - "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" - -G "${generator}" - ${architecture_options} - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}" - ${arg_OPTIONS} ${arg_OPTIONS_RELEASE}) - vcpkg_list(SET dbg_command - "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" - -G "${generator}" - ${architecture_options} - "-DCMAKE_BUILD_TYPE=Debug" - "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug" - ${arg_OPTIONS} ${arg_OPTIONS_DEBUG}) - - if(NOT arg_DISABLE_PARALLEL_CONFIGURE) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_DISABLE_SOURCE_CHANGES=ON") - - vcpkg_find_acquire_program(NINJA) - - #parallelize the configure step - set(ninja_configure_contents - "rule CreateProcess\n command = \$process\n\n" - ) - - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") - z_vcpkg_configure_cmake_build_cmakecache(ninja_configure_contents ".." "rel") - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") - z_vcpkg_configure_cmake_build_cmakecache(ninja_configure_contents "../../${TARGET_TRIPLET}-dbg" "dbg") - endif() - - file(MAKE_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure") - file(WRITE - "${build_dir_release}/vcpkg-parallel-configure/build.ninja" - "${ninja_configure_contents}") - - message(STATUS "${configuring_message}") - vcpkg_execute_required_process( - COMMAND "${NINJA}" -v - WORKING_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure" - LOGNAME "${arg_LOGFILE_BASE}" - SAVE_LOG_FILES ../../${TARGET_TRIPLET}-dbg/CMakeCache.txt ../CMakeCache.txt - ) - - vcpkg_list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-err.log") - else() - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") - message(STATUS "${configuring_message}-dbg") - vcpkg_execute_required_process( - COMMAND ${dbg_command} - WORKING_DIRECTORY "${build_dir_debug}" - LOGNAME "${arg_LOGFILE_BASE}-dbg" - SAVE_LOG_FILES CMakeCache.txt - ) - vcpkg_list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-err.log") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") - message(STATUS "${configuring_message}-rel") - vcpkg_execute_required_process( - COMMAND ${rel_command} - WORKING_DIRECTORY "${build_dir_release}" - LOGNAME "${arg_LOGFILE_BASE}-rel" - SAVE_LOG_FILES CMakeCache.txt - ) - vcpkg_list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-err.log") - endif() - endif() - - set(all_unused_variables) - foreach(config_log IN LISTS config_logs) - if(NOT EXISTS "${config_log}") - continue() - endif() - file(READ "${config_log}" log_contents) - debug_message("Reading configure log ${config_log}...") - if(NOT log_contents MATCHES "Manually-specified variables were not used by the project:\n\n(( [^\n]*\n)*)") - continue() - endif() - string(STRIP "${CMAKE_MATCH_1}" unused_variables) # remove leading ` ` and trailing `\n` - string(REPLACE "\n " ";" unused_variables "${unused_variables}") - debug_message("unused variables: ${unused_variables}") - foreach(unused_variable IN LISTS unused_variables) - if(unused_variable IN_LIST manually_specified_variables) - debug_message("manually specified unused variable: ${unused_variable}") - vcpkg_list(APPEND all_unused_variables "${unused_variable}") - else() - debug_message("unused variable (not manually specified): ${unused_variable}") - endif() - endforeach() - endforeach() - - if(DEFINED all_unused_variables) - vcpkg_list(REMOVE_DUPLICATES all_unused_variables) - vcpkg_list(JOIN all_unused_variables "\n " all_unused_variables) - message(WARNING "The following variables are not used in CMakeLists.txt: - ${all_unused_variables} -Please recheck them and remove the unnecessary options from the `vcpkg_cmake_configure` call. -If these options should still be passed for whatever reason, please use the `MAYBE_UNUSED_VARIABLES` argument.") - endif() - - if(NOT arg_Z_CMAKE_GET_VARS_USAGE) - set(Z_VCPKG_CMAKE_GENERATOR "${generator}" CACHE INTERNAL "The generator which was used to configure CMake.") - endif() -endfunction() diff --git a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_install.cmake b/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_install.cmake deleted file mode 100644 index 2bd8b4ea7..000000000 --- a/NorthstarDLL/include/libzip/share/vcpkg-cmake/vcpkg_cmake_install.cmake +++ /dev/null @@ -1,21 +0,0 @@ -include_guard(GLOBAL) - -function(vcpkg_cmake_install) - cmake_parse_arguments(PARSE_ARGV 0 "arg" "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "" "") - if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "vcpkg_cmake_install was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") - endif() - - set(args) - foreach(arg IN ITEMS DISABLE_PARALLEL ADD_BIN_TO_PATH) - if(arg_${arg}) - list(APPEND args "${arg}") - endif() - endforeach() - - vcpkg_cmake_build( - ${args} - LOGFILE_BASE install - TARGET install - ) -endfunction() diff --git a/NorthstarDLL/include/libzip/share/zlib/copyright b/NorthstarDLL/include/libzip/share/zlib/copyright deleted file mode 100644 index ab8ee6f71..000000000 --- a/NorthstarDLL/include/libzip/share/zlib/copyright +++ /dev/null @@ -1,22 +0,0 @@ -Copyright notice: - - (C) 1995-2022 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu diff --git a/NorthstarDLL/include/libzip/share/zlib/usage b/NorthstarDLL/include/libzip/share/zlib/usage deleted file mode 100644 index 0dfed7493..000000000 --- a/NorthstarDLL/include/libzip/share/zlib/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package zlib is compatible with built-in CMake targets: - - find_package(ZLIB REQUIRED) - target_link_libraries(main PRIVATE ZLIB::ZLIB) diff --git a/NorthstarDLL/include/libzip/share/zlib/vcpkg-cmake-wrapper.cmake b/NorthstarDLL/include/libzip/share/zlib/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 868a41851..000000000 --- a/NorthstarDLL/include/libzip/share/zlib/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,12 +0,0 @@ -find_path(ZLIB_INCLUDE_DIR NAMES zlib.h PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" NO_DEFAULT_PATH) -find_library(ZLIB_LIBRARY_RELEASE NAMES zlib z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) -find_library(ZLIB_LIBRARY_DEBUG NAMES zlibd z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) -if(NOT ZLIB_INCLUDE_DIR OR NOT (ZLIB_LIBRARY_RELEASE OR ZLIB_LIBRARY_DEBUG)) - message(FATAL_ERROR "Broken installation of vcpkg port zlib") -endif() -if(CMAKE_VERSION VERSION_LESS 3.4) - include(SelectLibraryConfigurations) - select_library_configurations(ZLIB) - unset(ZLIB_FOUND) -endif() -_find_package(${ARGS}) diff --git a/NorthstarDLL/include/libzip/share/zlib/vcpkg.spdx.json b/NorthstarDLL/include/libzip/share/zlib/vcpkg.spdx.json deleted file mode 100644 index 5e0d186d2..000000000 --- a/NorthstarDLL/include/libzip/share/zlib/vcpkg.spdx.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json", - "spdxVersion": "SPDX-2.2", - "dataLicense": "CC0-1.0", - "SPDXID": "SPDXRef-DOCUMENT", - "documentNamespace": "https://spdx.org/spdxdocs/zlib-x64-windows-1.2.13-2f3e3fb0-98ea-4a59-8feb-9eccea5e0572", - "name": "zlib:x64-windows@1.2.13 cfba80992a665d41aa217b6bd51c1720ddab0b5bcdc338feae38235d27cdc83c", - "creationInfo": { - "creators": [ - "Tool: vcpkg-5fdee72bc1fceca198fb1ab7589837206a8b81ba" - ], - "created": "2022-11-21T10:26:42Z" - }, - "relationships": [ - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "GENERATES", - "relatedSpdxElement": "SPDXRef-binary" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-0" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-1" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-2" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-3" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-4" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-5" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-6" - }, - { - "spdxElementId": "SPDXRef-port", - "relationshipType": "CONTAINS", - "relatedSpdxElement": "SPDXRef-file-7" - }, - { - "spdxElementId": "SPDXRef-binary", - "relationshipType": "GENERATED_FROM", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-0", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-1", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-2", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-3", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-4", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-5", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-6", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-7", - "relationshipType": "CONTAINED_BY", - "relatedSpdxElement": "SPDXRef-port" - }, - { - "spdxElementId": "SPDXRef-file-7", - "relationshipType": "DEPENDENCY_MANIFEST_OF", - "relatedSpdxElement": "SPDXRef-port" - } - ], - "packages": [ - { - "name": "zlib", - "SPDXID": "SPDXRef-port", - "versionInfo": "1.2.13", - "downloadLocation": "git+https://github.com/Microsoft/vcpkg#ports/zlib", - "homepage": "https://www.zlib.net/", - "licenseConcluded": "Zlib", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "description": "A compression library", - "comment": "This is the port (recipe) consumed by vcpkg." - }, - { - "name": "zlib:x64-windows", - "SPDXID": "SPDXRef-binary", - "versionInfo": "cfba80992a665d41aa217b6bd51c1720ddab0b5bcdc338feae38235d27cdc83c", - "downloadLocation": "NONE", - "licenseConcluded": "Zlib", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "comment": "This is a binary package built by vcpkg." - }, - { - "SPDXID": "SPDXRef-resource-1", - "name": "madler/zlib", - "downloadLocation": "git+https://github.com/madler/zlib@v1.2.13", - "licenseConcluded": "NOASSERTION", - "licenseDeclared": "NOASSERTION", - "copyrightText": "NOASSERTION", - "checksums": [ - { - "algorithm": "SHA512", - "checksumValue": "44b834fbfb50cca229209b8dbe1f96b258f19a49f5df23b80970b716371d856a4adf525edb4c6e0e645b180ea949cb90f5365a1d896160f297f56794dd888659" - } - ] - } - ], - "files": [ - { - "fileName": "./0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch", - "SPDXID": "SPDXRef-file-0", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "750b9542cb55e6328cca01d3ca997f1373b9530afa95e04213168676936e7bfa" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./0002-skip-building-examples.patch", - "SPDXID": "SPDXRef-file-1", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "835ddecfed752e0f49be9b0f8ff7ba76541cb0a150044327316e22ca84f8d0c2" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./0003-build-static-or-shared-not-both.patch", - "SPDXID": "SPDXRef-file-2", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "d6026271dcb3d8fc74b41e235620ae31576a798e77aa411c3af8cd9e948c02b1" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./0004-android-and-mingw-fixes.patch", - "SPDXID": "SPDXRef-file-3", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "37a43eddbcb1b7dde49e7659ae895dfd0ff1df66666c1371ba7d5bfc49d8b438" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./portfile.cmake", - "SPDXID": "SPDXRef-file-4", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "ac63047b644fa758860dd7ba48ff9a13b058c6f240b8e8d675b8fbba035976be" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./usage", - "SPDXID": "SPDXRef-file-5", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "be22662327df993eebc437495add75acb365ab18d37c7e5de735d4ea4f5d3083" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg-cmake-wrapper.cmake", - "SPDXID": "SPDXRef-file-6", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "5d49ef2ee6448479c2aad0e5f732e2676eaba0411860f9bebabe6002d66f57d1" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - }, - { - "fileName": "./vcpkg.json", - "SPDXID": "SPDXRef-file-7", - "checksums": [ - { - "algorithm": "SHA256", - "checksumValue": "bc94e2540efabe36130a806381a001c57194e7de67454ab7ff1e30aa15e6ce23" - } - ], - "licenseConcluded": "NOASSERTION", - "copyrightText": "NOASSERTION" - } - ] -} diff --git a/NorthstarDLL/include/libzip/share/zlib/vcpkg_abi_info.txt b/NorthstarDLL/include/libzip/share/zlib/vcpkg_abi_info.txt deleted file mode 100644 index 7716f77f8..000000000 --- a/NorthstarDLL/include/libzip/share/zlib/vcpkg_abi_info.txt +++ /dev/null @@ -1,21 +0,0 @@ -0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch 750b9542cb55e6328cca01d3ca997f1373b9530afa95e04213168676936e7bfa -0002-skip-building-examples.patch 835ddecfed752e0f49be9b0f8ff7ba76541cb0a150044327316e22ca84f8d0c2 -0003-build-static-or-shared-not-both.patch d6026271dcb3d8fc74b41e235620ae31576a798e77aa411c3af8cd9e948c02b1 -0004-android-and-mingw-fixes.patch 37a43eddbcb1b7dde49e7659ae895dfd0ff1df66666c1371ba7d5bfc49d8b438 -cmake 3.24.0 -features core -portfile.cmake ac63047b644fa758860dd7ba48ff9a13b058c6f240b8e8d675b8fbba035976be -ports.cmake b4accc7941cb5ff993e1a0434cea6df3e99331137294958437b2b86b7216e2e2 -post_build_checks 2 -powershell 7.3.0 -triplet x64-windows -triplet_abi 4556164a2cd3dd6f4742101eabb46def7e71b6e5856faa88e5d005aac12a803c-c0600b35e024ce0485ed253ef5419f3686f7257cfb58cb6a24febcb600fc4b4c-be3c2820fadf0f7b07a5310f662928d97bc31423 -usage be22662327df993eebc437495add75acb365ab18d37c7e5de735d4ea4f5d3083 -vcpkg-cmake 071f2c8514340d7a90771cbf8913118bd4e2bd505bbc0e7ee24cec27910f27c2 -vcpkg-cmake-wrapper.cmake 5d49ef2ee6448479c2aad0e5f732e2676eaba0411860f9bebabe6002d66f57d1 -vcpkg.json bc94e2540efabe36130a806381a001c57194e7de67454ab7ff1e30aa15e6ce23 -vcpkg_copy_pdbs d57e4f196c82dc562a9968c6155073094513c31e2de475694143d3aa47954b1c -vcpkg_fixup_pkgconfig 433d0d235b4e9f6c7bb8744a2f06a9f534b355da67d0d85b7c2daf15c8c77671 -vcpkg_from_git 42a2f33208e157d5332b7ce93a28fc3948d4c0be78cacc8013a5d6ce06eaede1 -vcpkg_from_github b743742296a114ea1b18ae99672e02f142c4eb2bef7f57d36c038bedbfb0502f -vcpkg_replace_string d43c8699ce27e25d47367c970d1c546f6bc36b6df8fb0be0c3986eb5830bd4f1 diff --git a/NorthstarDLL/include/libzip/tools/bzip2/bzip2.exe b/NorthstarDLL/include/libzip/tools/bzip2/bzip2.exe deleted file mode 100644 index 5dbb7889e824a84a0dc37bf878503587fe82d4c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 92672 zcmeEveSB2K)&FjG7XnGR0kVo1B-+&m7ikpKz$Tg-?!sN%Kq@Gxh|wsbwMubUqlU0? zHzn)jYO1ugRa<=YX|388tMVq*-30Q&Yj{ymL;+vAF`@w!!i(JB_srZ)c0=s1&+}9N z`tc#TbLQooIrDPn%$YNjlI!bD7L&4>G+rVAHuP z&E8Gt&X{+{y*cw2+;jVan}42De)HXT-{Z@<<+hv!{=0MTxI0IgHa+L(_uP8hn2d~p z4g+;TAbd~7zJC?Oe}3^hU%@=UUBCad@FD&kUQo%u`wQ>l-;W9x@bAZk6#vo_pB6rd zZ^gb(3ogU=$nQTYoX@|X6h46O)pwN7BiwOLO5G;Yt-tJNy8h~i%HwgJrt?f`DTB^6 z4K$lfvqfw`LO7F$ix3jw6qBi+Nbdfc+K`II>vW``9m}fYg^aRB!JZEl7icMDGM$`h zHoZ@QWoFZBL};nmG_OBJ82=(>lMli9Q_Q9r@wh&|c^*x_viK@_$*BKUNCaKmb`3lSz6reWY%GQzWLTdb8f7rOGSm+mY&J&1#Kab(WWH@H#iCTKa{m-XKfMtpjS!9#>oC z0Z(<;K;)EyEkNL|b>xQ z8jSKE4MuHhd8=-J7TI~;097a4Pi1eb&UMmA0!`BLfwk$Gs&=(G)apOfG1|i>rFz&A zMyWm8j8IHr!I=AD#U626>xm1MQE1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X|A>gxRD@ zD0BK7sVh|CkU35!<7PZYCp>xgb>9-rMm^^PEaO%D1JA7jI|H5w2KMJFzIWI<5X_RA(<9nVoaI+DpeKIo-(V>jFu zt_#58m=rD-pGC}cxPd)qoZySmsj-?U7*Da! zA<}^sv;!IRf^1j{?a&FY!@Cd#4{=O*N^Z%t)TA!=WmcZZS87v-x+JMbeHzd^jp&0u RX-pHE(v0BwpVnjrz5pn|?N9&! diff --git a/NorthstarDLL/include/libzip/tools/bzip2/bzip2recover.exe b/NorthstarDLL/include/libzip/tools/bzip2/bzip2recover.exe deleted file mode 100644 index ad286ffcf4447485c6fb00b77319b3892a05afcc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19456 zcmeHv4Ompw*8d)0a1?0J9K*~!>Y#W{L@`4V8wB(qgA$^dU&9E4Oae2`hl*x_Bj$LT zqMNB@A7*7%Sk_g;uL4n!#3J>UUlrF%M=_(1i>BrLf9sqxfYt4J|Ih#bzR&wS_s+fR z{MKH3?Y-Atd+o2ovGf_`ERZo41oHV9s|32(iq;FQf z+0I#QmU%W~A(vw;DzZ4ZxhBr$EaJ>XT=L{8T%je`6de}UMJreR#y_7we|gQ1+x>L@ zQug+g-(A^pPQ>qb zdMtahl?%256_=_djWWU^w2N^_try%I?;~2}1w&fZfM#lcCK?dq% zJwV9l_|u{3Xi1G#t%+bP1G%?=Mt0PK5@S`-R!LFpBl;?~nfyCFU9`<^qX80q!r)`- z3;#!YrUDBT$wv&n67?qjPH)`JlK-Uq9^gI7&QlnxX^?-qDZJ|vS5h3lh!;*eCkTn5 zuB)nL5kjgePu&OOa;i#}hA(p7)~x1*!@TPNHEvtX{ zRv}5{t3P(t)ueEzg^HzX#LBzNmG|&zhM_K39CP-q6k~>3sBtH$s;_oJsk)@lPUyQ- z(i?qKThwS@V&8up4;WnwbsN!ASxud18 zyxXCTxSzbq3qPxOUVNY0E!U}cek6Q;tXY^G>iSvb?62NA84kS7r%58K;lQzQ;G=0+ zh!s$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fKLvUbv>Nm_ zWP3sHBL4+oIcP5EENB(-sSM3Ciai>$qrgPSb>Ph)8mm^MABOxj@IRtW`p%5T(*oIk zq{o0S0nxficGA07id$;82DA=5ec)aV>W%ywq;CU8Bkvs`)jJ4zv{vE3$>JcZr*fd@ zAg8rx8j!wdr17H5a6EWA|1AO@N1E0t7x);+Qb80yMv?=+gZz8oXwYYl@ASZLdJqiu3~H(_EwZe;G1b zm*YXS9`^upkZ%CeTwMbGGswq)&wy@Er0)g}2GxS7{u1Qf3+j)w68WLPkARV&Pe3#_ zF-B688c+emeDF>iHz%I+#+M8jE7`A@qdX&W^+gLj{AK6uScEhVRVNd{jm?`G9s9Z zAKnv7KQT%2f9GF#IARG@fcNMdfq`8mJ{(A&#gjY(_$lZi@J+zTZdjMWcYL=_@8UP! zjyR%vfcrrQz&8R1;h%j`Ju$$wpj^@c-T+ZO^xvLX4sw8B0jva(KH=)#INyMO4EQ2Q zEDIcSC-x4=310{O0=@#+yAMV<0c`;%fg-?X1K$F1;OXykd7M;#K5#LJ>Lh$p=GOq} zzyA>heZqbq($NBE%X~KQbr9KE0lcTb#K!>}LHQ_4_>(Lr?5&k_IN%JKp9QposD1~K zi^N`nvROb2h~#U4U*aDA9OPc$sDYAP4}1+&0r?i-*D_DY;WAHh!iGWcC3t+(!#05q zfyZ|};@|ul!PDO=>F*HP;0b>Ltpfj_-@lIsg2b*W#J_z1(L~8)LNFO@(vu?at!Df+BlDKc}r|v^^)^RA{shDKzKUEOtwtV+h{C zjyBp0qZbbAhtIEy%z5~VXqw4p$BX=ge)wFe-`KD&95=>cbJ`uLMR}J0Vr{WfIh3@U z@D~EJqgbqm!*7iIQI{ztlxAWb2rrZJkE(F+=_S9Gj7t zk(ivEI%&f6=`!>GlBPk$|Cwr2_@;u}6&owIRBWrLtPq3eKac Date: Fri, 2 Dec 2022 23:17:25 +0100 Subject: [PATCH 10/78] refactor: remove GetVerifiedModsList method Squirrel VM does not need to know the list of verified mods, so GetVerifiedModsList method is no longer needed. We instead make FetchVerifiedModsList method available to Squirrel VM, so that verified mods list can be fetched while starting VM. --- NorthstarDLL/verifiedmods.cpp | 36 +++++------------------------------ 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 4664909d5..1c515f136 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -52,7 +52,7 @@ const char* modsTestString = * Fetches the list of verified mods from the master server, and store it in the verifiedModsJson variable. * Since master server does not expose verified mods resource *yet*, this uses mods stored in the modsTestString variable. **/ -void _FetchVerifiedModsList() +void FetchVerifiedModsList() { spdlog::info("Requesting verified mods list from {}", Cvar_ns_masterserver_hostname->GetString()); @@ -107,36 +107,12 @@ void _FetchVerifiedModsList() REQUEST_END_CLEANUP: curl_easy_cleanup(curl); + spdlog::info("Verified mods list successfully fetched."); }); requestThread.detach(); } -/** - * Loads up verified mods list in memory, and returns it when it was received from master server. - * This method is called by the Squirrel VM at launch. - **/ -std::string GetVerifiedModsList() -{ - if (verifiedModsJson.IsNull()) - { - _FetchVerifiedModsList(); - - while (verifiedModsJson.IsNull()) - { - spdlog::info("Wait for verified mods list to arrive..."); - Sleep(2000); // TODO do this asynchronously to avoid blocking the thread - } - - spdlog::info("Verified mods list arrived."); - } - - StringBuffer buffer; - Writer writer(buffer); - verifiedModsJson.Accept(writer); - return buffer.GetString(); -} - /** * Checks if a mod is verified by controlling if its name matches a key in the verified mods JSON * document, and if its version is included in the JSON versions list. @@ -275,12 +251,10 @@ void DownloadMod(char* modName, char* modVersion) */ -ADD_SQFUNC("string", GetVerifiedModsList, "", "", ScriptContext::UI) +ADD_SQFUNC("string", FetchVerifiedModsList, "", "", ScriptContext::UI) { - std::string mods = GetVerifiedModsList(); - const SQChar* buffer = mods.c_str(); - g_pSquirrel->pushstring(sqvm, buffer, -1); - return SQRESULT_NOTNULL; + FetchVerifiedModsList(); + return SQRESULT_NULL; } ADD_SQFUNC("bool", IsModVerified, "string modName, string modVersion", "", ScriptContext::UI) From 1d3bc0eb36a93842a1c141a1463b51b81d1709b4 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Fri, 2 Dec 2022 23:35:19 +0100 Subject: [PATCH 11/78] refactor: remove cURL code from FetchVerifiedModsList Since we're using a local verified mods list for now, we don't need code to fetch said list from master server. --- NorthstarDLL/verifiedmods.cpp | 45 +---------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 1c515f136..795e1905e 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -59,54 +59,11 @@ void FetchVerifiedModsList() std::thread requestThread( []() { - CURL* curl = curl_easy_init(); - - std::string readBuffer; - curl_easy_setopt(curl, CURLOPT_URL, fmt::format("{}/client/verifiedmods", Cvar_ns_masterserver_hostname->GetString()).c_str()); - curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET"); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer); - // TODO fetch list from masterserver verifiedModsJson.Parse(modsTestString); - return; - - CURLcode result = curl_easy_perform(curl); - spdlog::info(result); - - if (result == CURLcode::CURLE_OK) - { - spdlog::info("curl succeeded"); - - verifiedModsJson.Parse(readBuffer.c_str()); - - if (verifiedModsJson.HasParseError()) - { - spdlog::error("Failed reading masterserver verified mods response: encountered parse error."); - goto REQUEST_END_CLEANUP; - } - if (!verifiedModsJson.IsObject()) - { - spdlog::error("Failed reading masterserver verified mods response: root object is not an object"); - goto REQUEST_END_CLEANUP; - } - if (verifiedModsJson.HasMember("error")) - { - spdlog::error("Failed reading masterserver response: got fastify error response"); - spdlog::error(readBuffer); - if (verifiedModsJson["error"].HasMember("enum")) - spdlog::error(std::string(verifiedModsJson["error"]["enum"].GetString())); - else - spdlog::error(std::string("No error message provided")); - goto REQUEST_END_CLEANUP; - } - } - else - { - spdlog::error("Failed requesting verified mods list: error {}", curl_easy_strerror(result)); - } + goto REQUEST_END_CLEANUP; REQUEST_END_CLEANUP: - curl_easy_cleanup(curl); spdlog::info("Verified mods list successfully fetched."); }); requestThread.detach(); From ea304299c6ee101f5bf4d1fe40134702dc428c2d Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Fri, 2 Dec 2022 23:39:48 +0100 Subject: [PATCH 12/78] feat: add "NS" prefix to Squirrel-exposed methods --- NorthstarDLL/verifiedmods.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 795e1905e..2482299d8 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -208,13 +208,13 @@ void DownloadMod(char* modName, char* modVersion) */ -ADD_SQFUNC("string", FetchVerifiedModsList, "", "", ScriptContext::UI) +ADD_SQFUNC("string", NSFetchVerifiedModsList, "", "", ScriptContext::UI) { FetchVerifiedModsList(); return SQRESULT_NULL; } -ADD_SQFUNC("bool", IsModVerified, "string modName, string modVersion", "", ScriptContext::UI) +ADD_SQFUNC("bool", NSIsModVerified, "string modName, string modVersion", "", ScriptContext::UI) { const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); const SQChar* modVersion = g_pSquirrel->getstring(sqvm, 2); @@ -225,7 +225,7 @@ ADD_SQFUNC("bool", IsModVerified, "string modName, string modVersion", "", Scrip return SQRESULT_NOTNULL; } -ADD_SQFUNC("bool", IsModBeingDownloaded, "string modName", "", ScriptContext::UI) +ADD_SQFUNC("bool", NSIsModBeingDownloaded, "string modName", "", ScriptContext::UI) { const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); @@ -235,7 +235,7 @@ ADD_SQFUNC("bool", IsModBeingDownloaded, "string modName", "", ScriptContext::UI return SQRESULT_NOTNULL; } -ADD_SQFUNC("void", DownloadMod, "string modName, string modVersion", "", ScriptContext::UI) +ADD_SQFUNC("void", NSDownloadMod, "string modName, string modVersion", "", ScriptContext::UI) { const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); const SQChar* modVersion = g_pSquirrel->getstring(sqvm, 2); From 949529e8aff2796b519b1f2bf1a42cf22f3cc2a3 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Sat, 3 Dec 2022 23:42:19 +0100 Subject: [PATCH 13/78] build: add libzip library dependency --- NorthstarDLL/NorthstarDLL.vcxproj | 13 +- NorthstarDLL/NorthstarDLL.vcxproj.filters | 21 +- include/libzip/include/bzlib.h | 276 +++ include/libzip/include/zconf.h | 557 ++++++ include/libzip/include/zip.h | 487 ++++++ include/libzip/include/zipconf.h | 51 + include/libzip/include/zlib.h | 1935 +++++++++++++++++++++ include/libzip/lib/bz2.lib | Bin 0 -> 6224 bytes include/libzip/lib/zip.lib | Bin 0 -> 27916 bytes include/libzip/lib/zlib.lib | Bin 0 -> 16746 bytes 10 files changed, 3333 insertions(+), 7 deletions(-) create mode 100644 include/libzip/include/bzlib.h create mode 100644 include/libzip/include/zconf.h create mode 100644 include/libzip/include/zip.h create mode 100644 include/libzip/include/zipconf.h create mode 100644 include/libzip/include/zlib.h create mode 100644 include/libzip/lib/bz2.lib create mode 100644 include/libzip/lib/zip.lib create mode 100644 include/libzip/lib/zlib.lib diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj index 4c74c1cc1..e365b9b16 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj +++ b/NorthstarDLL/NorthstarDLL.vcxproj @@ -62,13 +62,13 @@ Use pch.h stdcpp20 - $(SolutionDir)include;%(AdditionalIncludeDirectories) + $(SolutionDir)include;$(SolutionDir)include\libzip\lib;%(AdditionalIncludeDirectories) Windows true false - $(SolutionDir)include\MinHook.x64.lib;$(SolutionDir)include\libcurl\lib\libcurl_a.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies) + $(SolutionDir)include\MinHook.x64.lib;$(SolutionDir)include\libcurl\lib\libcurl_a.lib;$(SolutionDir)include\libzip\lib\zip.lib;$(SolutionDir)include\libzip\lib\zlib.lib;$(SolutionDir)include\libzip\lib\bz2.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies) %(AdditionalLibraryDirectories) @@ -92,7 +92,7 @@ Use pch.h stdcpp20 - $(SolutionDir)include;%(AdditionalIncludeDirectories) + $(SolutionDir)include;$(SolutionDir)include\libzip\lib;%(AdditionalIncludeDirectories) MultiThreadedDLL Disabled @@ -102,7 +102,7 @@ true true false - $(SolutionDir)include\MinHook.x64.lib;$(SolutionDir)include\libcurl\lib\libcurl_a.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies) + $(SolutionDir)include\MinHook.x64.lib;$(SolutionDir)include\libcurl\lib\libcurl_a.lib;$(SolutionDir)include\libzip\lib\zip.lib;$(SolutionDir)include\libzip\lib\zlib.lib;$(SolutionDir)include\libzip\lib\bz2.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies) %(AdditionalLibraryDirectories) @@ -127,6 +127,11 @@ + + + + + diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters index 0a5b68b9c..bb7d255a4 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj.filters +++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters @@ -299,7 +299,7 @@ Header Files\Console - + Header Files\Squirrel @@ -1116,9 +1116,9 @@ Header Files\include\spdlog\sinks - + Header Files\include\spdlog\sinks - + Header Files\include\spdlog\sinks @@ -1128,6 +1128,21 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + diff --git a/include/libzip/include/bzlib.h b/include/libzip/include/bzlib.h new file mode 100644 index 000000000..015f8d1cb --- /dev/null +++ b/include/libzip/include/bzlib.h @@ -0,0 +1,276 @@ + +/*-------------------------------------------------------------*/ +/*--- Public header file for the library. ---*/ +/*--- bzlib.h ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.8 of 13 July 2019 + Copyright (C) 1996-2019 Julian Seward + + Please read the WARNING, DISCLAIMER and PATENTS sections in the + README file. + + This program is released under the terms of the license contained + in the file LICENSE. + ------------------------------------------------------------------ */ + + +#ifndef _BZLIB_H +#define _BZLIB_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define BZ_RUN 0 +#define BZ_FLUSH 1 +#define BZ_FINISH 2 + +#define BZ_OK 0 +#define BZ_RUN_OK 1 +#define BZ_FLUSH_OK 2 +#define BZ_FINISH_OK 3 +#define BZ_STREAM_END 4 +#define BZ_SEQUENCE_ERROR (-1) +#define BZ_PARAM_ERROR (-2) +#define BZ_MEM_ERROR (-3) +#define BZ_DATA_ERROR (-4) +#define BZ_DATA_ERROR_MAGIC (-5) +#define BZ_IO_ERROR (-6) +#define BZ_UNEXPECTED_EOF (-7) +#define BZ_OUTBUFF_FULL (-8) +#define BZ_CONFIG_ERROR (-9) + +typedef + struct { + char *next_in; + unsigned int avail_in; + unsigned int total_in_lo32; + unsigned int total_in_hi32; + + char *next_out; + unsigned int avail_out; + unsigned int total_out_lo32; + unsigned int total_out_hi32; + + void *state; + + void *(*bzalloc)(void *,int,int); + void (*bzfree)(void *,void *); + void *opaque; + } + bz_stream; + +#ifndef BZ_NO_STDIO +/* Need a definitition for FILE */ +#include +#endif + +#ifdef _WIN32 +# ifdef small + /* windows.h define small to char */ +# undef small +# endif +# define BZ_API(func) func +# if defined(BZ_BUILD_DLL) +# define BZ_EXTERN __declspec(dllexport) +# elif 1 +# define BZ_EXTERN __declspec(dllimport) +# else +# define BZ_EXTERN +# endif +#else +# define BZ_API(func) func +# define BZ_EXTERN extern +#endif + + +/*-- Core (low-level) library functions --*/ + +BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( + bz_stream* strm, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN int BZ_API(BZ2_bzCompress) ( + bz_stream* strm, + int action + ); + +BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( + bz_stream* strm + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( + bz_stream *strm, + int verbosity, + int small + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( + bz_stream* strm + ); + +BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( + bz_stream *strm + ); + + + +/*-- High(er) level library functions --*/ + +#ifndef BZ_NO_STDIO +#define BZ_MAX_UNUSED 5000 + +typedef void BZFILE; + +BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( + int* bzerror, + FILE* f, + int verbosity, + int small, + void* unused, + int nUnused + ); + +BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( + int* bzerror, + BZFILE* b + ); + +BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( + int* bzerror, + BZFILE* b, + void** unused, + int* nUnused + ); + +BZ_EXTERN int BZ_API(BZ2_bzRead) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( + int* bzerror, + FILE* f, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN void BZ_API(BZ2_bzWrite) ( + int* bzerror, + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in, + unsigned int* nbytes_out + ); + +BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( + int* bzerror, + BZFILE* b, + int abandon, + unsigned int* nbytes_in_lo32, + unsigned int* nbytes_in_hi32, + unsigned int* nbytes_out_lo32, + unsigned int* nbytes_out_hi32 + ); +#endif + + +/*-- Utility functions --*/ + +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int blockSize100k, + int verbosity, + int workFactor + ); + +BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( + char* dest, + unsigned int* destLen, + char* source, + unsigned int sourceLen, + int small, + int verbosity + ); + + +/*-- + Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) + to support better zlib compatibility. + This code is not _officially_ part of libbzip2 (yet); + I haven't tested it, documented it, or considered the + threading-safeness of it. + If this code breaks, please contact both Yoshioka and me. +--*/ + +BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( + void + ); + +#ifndef BZ_NO_STDIO +BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( + const char *path, + const char *mode + ); + +BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( + int fd, + const char *mode + ); + +BZ_EXTERN int BZ_API(BZ2_bzread) ( + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN int BZ_API(BZ2_bzwrite) ( + BZFILE* b, + void* buf, + int len + ); + +BZ_EXTERN int BZ_API(BZ2_bzflush) ( + BZFILE* b + ); + +BZ_EXTERN void BZ_API(BZ2_bzclose) ( + BZFILE* b + ); + +BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( + BZFILE *b, + int *errnum + ); +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +/*-------------------------------------------------------------*/ +/*--- end bzlib.h ---*/ +/*-------------------------------------------------------------*/ diff --git a/include/libzip/include/zconf.h b/include/libzip/include/zconf.h new file mode 100644 index 000000000..b3309e8f7 --- /dev/null +++ b/include/libzip/include/zconf.h @@ -0,0 +1,557 @@ +/* zconf.h -- configuration of the zlib compression library + * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +/* @(#) $Id$ */ + +#ifndef ZCONF_H +#define ZCONF_H +/* #undef Z_PREFIX */ +/* #undef Z_HAVE_UNISTD_H */ + +/* + * If you *really* need a unique prefix for all types and library functions, + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. + * Even better than compiling with -DZ_PREFIX would be to use configure to set + * this permanently in zconf.h using "./configure --zprefix". + */ +#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ +# define Z_PREFIX_SET + +/* all linked symbols and init macros */ +# define _dist_code z__dist_code +# define _length_code z__length_code +# define _tr_align z__tr_align +# define _tr_flush_bits z__tr_flush_bits +# define _tr_flush_block z__tr_flush_block +# define _tr_init z__tr_init +# define _tr_stored_block z__tr_stored_block +# define _tr_tally z__tr_tally +# define adler32 z_adler32 +# define adler32_combine z_adler32_combine +# define adler32_combine64 z_adler32_combine64 +# define adler32_z z_adler32_z +# ifndef Z_SOLO +# define compress z_compress +# define compress2 z_compress2 +# define compressBound z_compressBound +# endif +# define crc32 z_crc32 +# define crc32_combine z_crc32_combine +# define crc32_combine64 z_crc32_combine64 +# define crc32_combine_gen z_crc32_combine_gen +# define crc32_combine_gen64 z_crc32_combine_gen64 +# define crc32_combine_op z_crc32_combine_op +# define crc32_z z_crc32_z +# define deflate z_deflate +# define deflateBound z_deflateBound +# define deflateCopy z_deflateCopy +# define deflateEnd z_deflateEnd +# define deflateGetDictionary z_deflateGetDictionary +# define deflateInit z_deflateInit +# define deflateInit2 z_deflateInit2 +# define deflateInit2_ z_deflateInit2_ +# define deflateInit_ z_deflateInit_ +# define deflateParams z_deflateParams +# define deflatePending z_deflatePending +# define deflatePrime z_deflatePrime +# define deflateReset z_deflateReset +# define deflateResetKeep z_deflateResetKeep +# define deflateSetDictionary z_deflateSetDictionary +# define deflateSetHeader z_deflateSetHeader +# define deflateTune z_deflateTune +# define deflate_copyright z_deflate_copyright +# define get_crc_table z_get_crc_table +# ifndef Z_SOLO +# define gz_error z_gz_error +# define gz_intmax z_gz_intmax +# define gz_strwinerror z_gz_strwinerror +# define gzbuffer z_gzbuffer +# define gzclearerr z_gzclearerr +# define gzclose z_gzclose +# define gzclose_r z_gzclose_r +# define gzclose_w z_gzclose_w +# define gzdirect z_gzdirect +# define gzdopen z_gzdopen +# define gzeof z_gzeof +# define gzerror z_gzerror +# define gzflush z_gzflush +# define gzfread z_gzfread +# define gzfwrite z_gzfwrite +# define gzgetc z_gzgetc +# define gzgetc_ z_gzgetc_ +# define gzgets z_gzgets +# define gzoffset z_gzoffset +# define gzoffset64 z_gzoffset64 +# define gzopen z_gzopen +# define gzopen64 z_gzopen64 +# ifdef _WIN32 +# define gzopen_w z_gzopen_w +# endif +# define gzprintf z_gzprintf +# define gzputc z_gzputc +# define gzputs z_gzputs +# define gzread z_gzread +# define gzrewind z_gzrewind +# define gzseek z_gzseek +# define gzseek64 z_gzseek64 +# define gzsetparams z_gzsetparams +# define gztell z_gztell +# define gztell64 z_gztell64 +# define gzungetc z_gzungetc +# define gzvprintf z_gzvprintf +# define gzwrite z_gzwrite +# endif +# define inflate z_inflate +# define inflateBack z_inflateBack +# define inflateBackEnd z_inflateBackEnd +# define inflateBackInit z_inflateBackInit +# define inflateBackInit_ z_inflateBackInit_ +# define inflateCodesUsed z_inflateCodesUsed +# define inflateCopy z_inflateCopy +# define inflateEnd z_inflateEnd +# define inflateGetDictionary z_inflateGetDictionary +# define inflateGetHeader z_inflateGetHeader +# define inflateInit z_inflateInit +# define inflateInit2 z_inflateInit2 +# define inflateInit2_ z_inflateInit2_ +# define inflateInit_ z_inflateInit_ +# define inflateMark z_inflateMark +# define inflatePrime z_inflatePrime +# define inflateReset z_inflateReset +# define inflateReset2 z_inflateReset2 +# define inflateResetKeep z_inflateResetKeep +# define inflateSetDictionary z_inflateSetDictionary +# define inflateSync z_inflateSync +# define inflateSyncPoint z_inflateSyncPoint +# define inflateUndermine z_inflateUndermine +# define inflateValidate z_inflateValidate +# define inflate_copyright z_inflate_copyright +# define inflate_fast z_inflate_fast +# define inflate_table z_inflate_table +# ifndef Z_SOLO +# define uncompress z_uncompress +# define uncompress2 z_uncompress2 +# endif +# define zError z_zError +# ifndef Z_SOLO +# define zcalloc z_zcalloc +# define zcfree z_zcfree +# endif +# define zlibCompileFlags z_zlibCompileFlags +# define zlibVersion z_zlibVersion + +/* all zlib typedefs in zlib.h and zconf.h */ +# define Byte z_Byte +# define Bytef z_Bytef +# define alloc_func z_alloc_func +# define charf z_charf +# define free_func z_free_func +# ifndef Z_SOLO +# define gzFile z_gzFile +# endif +# define gz_header z_gz_header +# define gz_headerp z_gz_headerp +# define in_func z_in_func +# define intf z_intf +# define out_func z_out_func +# define uInt z_uInt +# define uIntf z_uIntf +# define uLong z_uLong +# define uLongf z_uLongf +# define voidp z_voidp +# define voidpc z_voidpc +# define voidpf z_voidpf + +/* all zlib structs in zlib.h and zconf.h */ +# define gz_header_s z_gz_header_s +# define internal_state z_internal_state + +#endif + +#if defined(__MSDOS__) && !defined(MSDOS) +# define MSDOS +#endif +#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) +# define OS2 +#endif +#if defined(_WINDOWS) && !defined(WINDOWS) +# define WINDOWS +#endif +#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) +# ifndef WIN32 +# define WIN32 +# endif +#endif +#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) +# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) +# ifndef SYS16BIT +# define SYS16BIT +# endif +# endif +#endif + +/* + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more + * than 64k bytes at a time (needed on systems with 16-bit int). + */ +#ifdef SYS16BIT +# define MAXSEG_64K +#endif +#ifdef MSDOS +# define UNALIGNED_OK +#endif + +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif +#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) +# define STDC +#endif +#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) +# define STDC +#endif +#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) +# define STDC +#endif +#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) +# define STDC +#endif + +#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ +# define STDC +#endif + +#ifndef STDC +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ +# define const /* note: need a more gentle solution here */ +# endif +#endif + +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + +#ifdef Z_SOLO + typedef unsigned long z_size_t; +#else +# define z_longlong long long +# if defined(NO_SIZE_T) + typedef unsigned NO_SIZE_T z_size_t; +# elif defined(STDC) +# include + typedef size_t z_size_t; +# else + typedef unsigned long z_size_t; +# endif +# undef z_longlong +#endif + +/* Maximum value for memLevel in deflateInit2 */ +#ifndef MAX_MEM_LEVEL +# ifdef MAXSEG_64K +# define MAX_MEM_LEVEL 8 +# else +# define MAX_MEM_LEVEL 9 +# endif +#endif + +/* Maximum value for windowBits in deflateInit2 and inflateInit2. + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files + * created by gzip. (Files created by minigzip can still be extracted by + * gzip.) + */ +#ifndef MAX_WBITS +# define MAX_WBITS 15 /* 32K LZ77 window */ +#endif + +/* The memory requirements for deflate are (in bytes): + (1 << (windowBits+2)) + (1 << (memLevel+9)) + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) + plus a few kilobytes for small objects. For example, if you want to reduce + the default memory requirements from 256K to 128K, compile with + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" + Of course this will generally degrade compression (there's no free lunch). + + The memory requirements for inflate are (in bytes) 1 << windowBits + that is, 32K for windowBits=15 (default value) plus about 7 kilobytes + for small objects. +*/ + + /* Type declarations */ + +#ifndef OF /* function prototypes */ +# ifdef STDC +# define OF(args) args +# else +# define OF(args) () +# endif +#endif + +#ifndef Z_ARG /* function prototypes for stdarg */ +# if defined(STDC) || defined(Z_HAVE_STDARG_H) +# define Z_ARG(args) args +# else +# define Z_ARG(args) () +# endif +#endif + +/* The following definitions for FAR are needed only for MSDOS mixed + * model programming (small or medium model with some far allocations). + * This was tested only with MSC; for other MSDOS compilers you may have + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, + * just define FAR to be empty. + */ +#ifdef SYS16BIT +# if defined(M_I86SM) || defined(M_I86MM) + /* MSC small or medium model */ +# define SMALL_MEDIUM +# ifdef _MSC_VER +# define FAR _far +# else +# define FAR far +# endif +# endif +# if (defined(__SMALL__) || defined(__MEDIUM__)) + /* Turbo C small or medium model */ +# define SMALL_MEDIUM +# ifdef __BORLANDC__ +# define FAR _far +# else +# define FAR far +# endif +# endif +#endif + +#if defined(WINDOWS) || defined(WIN32) + /* If building or using zlib as a DLL, define ZLIB_DLL. + * This is not mandatory, but it offers a little performance increase. + */ +# if 1 +# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) +# ifdef ZLIB_INTERNAL +# define ZEXTERN extern __declspec(dllexport) +# else +# define ZEXTERN extern __declspec(dllimport) +# endif +# endif +# endif /* ZLIB_DLL */ + /* If building or using zlib with the WINAPI/WINAPIV calling convention, + * define ZLIB_WINAPI. + * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. + */ +# ifdef ZLIB_WINAPI +# ifdef FAR +# undef FAR +# endif +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include + /* No need for _export, use ZLIB.DEF instead. */ + /* For complete Windows compatibility, use WINAPI, not __stdcall. */ +# define ZEXPORT WINAPI +# ifdef WIN32 +# define ZEXPORTVA WINAPIV +# else +# define ZEXPORTVA FAR CDECL +# endif +# endif +#endif + +#if defined (__BEOS__) +# if 1 +# ifdef ZLIB_INTERNAL +# define ZEXPORT __declspec(dllexport) +# define ZEXPORTVA __declspec(dllexport) +# else +# define ZEXPORT __declspec(dllimport) +# define ZEXPORTVA __declspec(dllimport) +# endif +# endif +#endif + +#ifndef ZEXTERN +# define ZEXTERN extern +#endif +#ifndef ZEXPORT +# define ZEXPORT +#endif +#ifndef ZEXPORTVA +# define ZEXPORTVA +#endif + +#ifndef FAR +# define FAR +#endif + +#if !defined(__MACTYPES__) +typedef unsigned char Byte; /* 8 bits */ +#endif +typedef unsigned int uInt; /* 16 bits or more */ +typedef unsigned long uLong; /* 32 bits or more */ + +#ifdef SMALL_MEDIUM + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ +# define Bytef Byte FAR +#else + typedef Byte FAR Bytef; +#endif +typedef char FAR charf; +typedef int FAR intf; +typedef uInt FAR uIntf; +typedef uLong FAR uLongf; + +#ifdef STDC + typedef void const *voidpc; + typedef void FAR *voidpf; + typedef void *voidp; +#else + typedef Byte const *voidpc; + typedef Byte FAR *voidpf; + typedef Byte *voidp; +#endif + +#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) +# include +# if (UINT_MAX == 0xffffffffUL) +# define Z_U4 unsigned +# elif (ULONG_MAX == 0xffffffffUL) +# define Z_U4 unsigned long +# elif (USHRT_MAX == 0xffffffffUL) +# define Z_U4 unsigned short +# endif +#endif + +#ifdef Z_U4 + typedef Z_U4 z_crc_t; +#else + typedef unsigned long z_crc_t; +#endif + +#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 +# define Z_HAVE_UNISTD_H +# elif HAVE_UNISTD_H != 0 +# define Z_HAVE_UNISTD_H +# endif +#endif + +#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 +# define Z_HAVE_STDARG_H +# elif HAVE_STDARG_H != 0 +# define Z_HAVE_STDARG_H +# endif +#endif + +#ifdef STDC +# ifndef Z_SOLO +# include /* for off_t */ +# endif +#endif + +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifndef Z_SOLO +# include /* for va_list */ +# endif +#endif + +#ifdef _WIN32 +# ifndef Z_SOLO +# include /* for wchar_t */ +# endif +#endif + +/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and + * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even + * though the former does not conform to the LFS document), but considering + * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as + * equivalently requesting no 64-bit operations + */ +#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 +# undef _LARGEFILE64_SOURCE +#endif + +#ifndef Z_HAVE_UNISTD_H +# ifdef __WATCOMC__ +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_HAVE_UNISTD_H +# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32) +# define Z_HAVE_UNISTD_H +# endif +#endif +#ifndef Z_SOLO +# if defined(Z_HAVE_UNISTD_H) +# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ +# ifdef VMS +# include /* for off_t */ +# endif +# ifndef z_off_t +# define z_off_t off_t +# endif +# endif +#endif + +#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 +# define Z_LFS64 +#endif + +#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) +# define Z_LARGE64 +#endif + +#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) +# define Z_WANT64 +#endif + +#if !defined(SEEK_SET) && !defined(Z_SOLO) +# define SEEK_SET 0 /* Seek from beginning of file. */ +# define SEEK_CUR 1 /* Seek from current position. */ +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ +#endif + +#ifndef z_off_t +# define z_off_t long +#endif + +#if !defined(_WIN32) && defined(Z_LARGE64) +# define z_off64_t off64_t +#else +# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) +# define z_off64_t __int64 +# else +# define z_off64_t z_off_t +# endif +#endif + +/* MVS linker does not support external names larger than 8 bytes */ +#if defined(__MVS__) + #pragma map(deflateInit_,"DEIN") + #pragma map(deflateInit2_,"DEIN2") + #pragma map(deflateEnd,"DEEND") + #pragma map(deflateBound,"DEBND") + #pragma map(inflateInit_,"ININ") + #pragma map(inflateInit2_,"ININ2") + #pragma map(inflateEnd,"INEND") + #pragma map(inflateSync,"INSY") + #pragma map(inflateSetDictionary,"INSEDI") + #pragma map(compressBound,"CMBND") + #pragma map(inflate_table,"INTABL") + #pragma map(inflate_fast,"INFA") + #pragma map(inflate_copyright,"INCOPY") +#endif + +#endif /* ZCONF_H */ diff --git a/include/libzip/include/zip.h b/include/libzip/include/zip.h new file mode 100644 index 000000000..283607a5a --- /dev/null +++ b/include/libzip/include/zip.h @@ -0,0 +1,487 @@ +#ifndef _HAD_ZIP_H +#define _HAD_ZIP_H + +/* + zip.h -- exported declarations. + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* fix autoindent */ +#endif +#endif + +#include + +#ifndef ZIP_EXTERN +#ifndef ZIP_STATIC +#ifdef _WIN32 +#define ZIP_EXTERN __declspec(dllimport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +#define ZIP_EXTERN __attribute__((visibility("default"))) +#else +#define ZIP_EXTERN +#endif +#else +#define ZIP_EXTERN +#endif +#endif + +#include +#include +#include + +/* flags for zip_open */ + +#define ZIP_CREATE 1 +#define ZIP_EXCL 2 +#define ZIP_CHECKCONS 4 +#define ZIP_TRUNCATE 8 +#define ZIP_RDONLY 16 + + +/* flags for zip_name_locate, zip_fopen, zip_stat, ... */ + +#define ZIP_FL_NOCASE 1u /* ignore case on name lookup */ +#define ZIP_FL_NODIR 2u /* ignore directory component */ +#define ZIP_FL_COMPRESSED 4u /* read compressed data */ +#define ZIP_FL_UNCHANGED 8u /* use original data, ignoring changes */ +#define ZIP_FL_RECOMPRESS 16u /* force recompression of data */ +#define ZIP_FL_ENCRYPTED 32u /* read encrypted data (implies ZIP_FL_COMPRESSED) */ +#define ZIP_FL_ENC_GUESS 0u /* guess string encoding (is default) */ +#define ZIP_FL_ENC_RAW 64u /* get unmodified string */ +#define ZIP_FL_ENC_STRICT 128u /* follow specification strictly */ +#define ZIP_FL_LOCAL 256u /* in local header */ +#define ZIP_FL_CENTRAL 512u /* in central directory */ +/* 1024u reserved for internal use */ +#define ZIP_FL_ENC_UTF_8 2048u /* string is UTF-8 encoded */ +#define ZIP_FL_ENC_CP437 4096u /* string is CP437 encoded */ +#define ZIP_FL_OVERWRITE 8192u /* zip_file_add: if file with name exists, overwrite (replace) it */ + +/* archive global flags flags */ + +#define ZIP_AFL_RDONLY 2u /* read only -- cannot be cleared */ + + +/* create a new extra field */ + +#define ZIP_EXTRA_FIELD_ALL ZIP_UINT16_MAX +#define ZIP_EXTRA_FIELD_NEW ZIP_UINT16_MAX + + +/* libzip error codes */ + +#define ZIP_ER_OK 0 /* N No error */ +#define ZIP_ER_MULTIDISK 1 /* N Multi-disk zip archives not supported */ +#define ZIP_ER_RENAME 2 /* S Renaming temporary file failed */ +#define ZIP_ER_CLOSE 3 /* S Closing zip archive failed */ +#define ZIP_ER_SEEK 4 /* S Seek error */ +#define ZIP_ER_READ 5 /* S Read error */ +#define ZIP_ER_WRITE 6 /* S Write error */ +#define ZIP_ER_CRC 7 /* N CRC error */ +#define ZIP_ER_ZIPCLOSED 8 /* N Containing zip archive was closed */ +#define ZIP_ER_NOENT 9 /* N No such file */ +#define ZIP_ER_EXISTS 10 /* N File already exists */ +#define ZIP_ER_OPEN 11 /* S Can't open file */ +#define ZIP_ER_TMPOPEN 12 /* S Failure to create temporary file */ +#define ZIP_ER_ZLIB 13 /* Z Zlib error */ +#define ZIP_ER_MEMORY 14 /* N Malloc failure */ +#define ZIP_ER_CHANGED 15 /* N Entry has been changed */ +#define ZIP_ER_COMPNOTSUPP 16 /* N Compression method not supported */ +#define ZIP_ER_EOF 17 /* N Premature end of file */ +#define ZIP_ER_INVAL 18 /* N Invalid argument */ +#define ZIP_ER_NOZIP 19 /* N Not a zip archive */ +#define ZIP_ER_INTERNAL 20 /* N Internal error */ +#define ZIP_ER_INCONS 21 /* L Zip archive inconsistent */ +#define ZIP_ER_REMOVE 22 /* S Can't remove file */ +#define ZIP_ER_DELETED 23 /* N Entry has been deleted */ +#define ZIP_ER_ENCRNOTSUPP 24 /* N Encryption method not supported */ +#define ZIP_ER_RDONLY 25 /* N Read-only archive */ +#define ZIP_ER_NOPASSWD 26 /* N No password provided */ +#define ZIP_ER_WRONGPASSWD 27 /* N Wrong password provided */ +#define ZIP_ER_OPNOTSUPP 28 /* N Operation not supported */ +#define ZIP_ER_INUSE 29 /* N Resource still in use */ +#define ZIP_ER_TELL 30 /* S Tell error */ +#define ZIP_ER_COMPRESSED_DATA 31 /* N Compressed data invalid */ +#define ZIP_ER_CANCELLED 32 /* N Operation cancelled */ + +/* type of system error value */ + +#define ZIP_ET_NONE 0 /* sys_err unused */ +#define ZIP_ET_SYS 1 /* sys_err is errno */ +#define ZIP_ET_ZLIB 2 /* sys_err is zlib error code */ +#define ZIP_ET_LIBZIP 3 /* sys_err is libzip error code */ + +/* compression methods */ + +#define ZIP_CM_DEFAULT -1 /* better of deflate or store */ +#define ZIP_CM_STORE 0 /* stored (uncompressed) */ +#define ZIP_CM_SHRINK 1 /* shrunk */ +#define ZIP_CM_REDUCE_1 2 /* reduced with factor 1 */ +#define ZIP_CM_REDUCE_2 3 /* reduced with factor 2 */ +#define ZIP_CM_REDUCE_3 4 /* reduced with factor 3 */ +#define ZIP_CM_REDUCE_4 5 /* reduced with factor 4 */ +#define ZIP_CM_IMPLODE 6 /* imploded */ +/* 7 - Reserved for Tokenizing compression algorithm */ +#define ZIP_CM_DEFLATE 8 /* deflated */ +#define ZIP_CM_DEFLATE64 9 /* deflate64 */ +#define ZIP_CM_PKWARE_IMPLODE 10 /* PKWARE imploding */ +/* 11 - Reserved by PKWARE */ +#define ZIP_CM_BZIP2 12 /* compressed using BZIP2 algorithm */ +/* 13 - Reserved by PKWARE */ +#define ZIP_CM_LZMA 14 /* LZMA (EFS) */ +/* 15-17 - Reserved by PKWARE */ +#define ZIP_CM_TERSE 18 /* compressed using IBM TERSE (new) */ +#define ZIP_CM_LZ77 19 /* IBM LZ77 z Architecture (PFS) */ +/* 20 - old value for Zstandard */ +#define ZIP_CM_LZMA2 33 +#define ZIP_CM_ZSTD 93 /* Zstandard compressed data */ +#define ZIP_CM_XZ 95 /* XZ compressed data */ +#define ZIP_CM_JPEG 96 /* Compressed Jpeg data */ +#define ZIP_CM_WAVPACK 97 /* WavPack compressed data */ +#define ZIP_CM_PPMD 98 /* PPMd version I, Rev 1 */ + +/* encryption methods */ + +#define ZIP_EM_NONE 0 /* not encrypted */ +#define ZIP_EM_TRAD_PKWARE 1 /* traditional PKWARE encryption */ +#if 0 /* Strong Encryption Header not parsed yet */ +#define ZIP_EM_DES 0x6601 /* strong encryption: DES */ +#define ZIP_EM_RC2_OLD 0x6602 /* strong encryption: RC2, version < 5.2 */ +#define ZIP_EM_3DES_168 0x6603 +#define ZIP_EM_3DES_112 0x6609 +#define ZIP_EM_PKZIP_AES_128 0x660e +#define ZIP_EM_PKZIP_AES_192 0x660f +#define ZIP_EM_PKZIP_AES_256 0x6610 +#define ZIP_EM_RC2 0x6702 /* strong encryption: RC2, version >= 5.2 */ +#define ZIP_EM_RC4 0x6801 +#endif +#define ZIP_EM_AES_128 0x0101 /* Winzip AES encryption */ +#define ZIP_EM_AES_192 0x0102 +#define ZIP_EM_AES_256 0x0103 +#define ZIP_EM_UNKNOWN 0xffff /* unknown algorithm */ + +#define ZIP_OPSYS_DOS 0x00u +#define ZIP_OPSYS_AMIGA 0x01u +#define ZIP_OPSYS_OPENVMS 0x02u +#define ZIP_OPSYS_UNIX 0x03u +#define ZIP_OPSYS_VM_CMS 0x04u +#define ZIP_OPSYS_ATARI_ST 0x05u +#define ZIP_OPSYS_OS_2 0x06u +#define ZIP_OPSYS_MACINTOSH 0x07u +#define ZIP_OPSYS_Z_SYSTEM 0x08u +#define ZIP_OPSYS_CPM 0x09u +#define ZIP_OPSYS_WINDOWS_NTFS 0x0au +#define ZIP_OPSYS_MVS 0x0bu +#define ZIP_OPSYS_VSE 0x0cu +#define ZIP_OPSYS_ACORN_RISC 0x0du +#define ZIP_OPSYS_VFAT 0x0eu +#define ZIP_OPSYS_ALTERNATE_MVS 0x0fu +#define ZIP_OPSYS_BEOS 0x10u +#define ZIP_OPSYS_TANDEM 0x11u +#define ZIP_OPSYS_OS_400 0x12u +#define ZIP_OPSYS_OS_X 0x13u + +#define ZIP_OPSYS_DEFAULT ZIP_OPSYS_UNIX + + +enum zip_source_cmd { + ZIP_SOURCE_OPEN, /* prepare for reading */ + ZIP_SOURCE_READ, /* read data */ + ZIP_SOURCE_CLOSE, /* reading is done */ + ZIP_SOURCE_STAT, /* get meta information */ + ZIP_SOURCE_ERROR, /* get error information */ + ZIP_SOURCE_FREE, /* cleanup and free resources */ + ZIP_SOURCE_SEEK, /* set position for reading */ + ZIP_SOURCE_TELL, /* get read position */ + ZIP_SOURCE_BEGIN_WRITE, /* prepare for writing */ + ZIP_SOURCE_COMMIT_WRITE, /* writing is done */ + ZIP_SOURCE_ROLLBACK_WRITE, /* discard written changes */ + ZIP_SOURCE_WRITE, /* write data */ + ZIP_SOURCE_SEEK_WRITE, /* set position for writing */ + ZIP_SOURCE_TELL_WRITE, /* get write position */ + ZIP_SOURCE_SUPPORTS, /* check whether source supports command */ + ZIP_SOURCE_REMOVE, /* remove file */ + ZIP_SOURCE_RESERVED_1, /* previously used internally */ + ZIP_SOURCE_BEGIN_WRITE_CLONING, /* like ZIP_SOURCE_BEGIN_WRITE, but keep part of original file */ + ZIP_SOURCE_ACCEPT_EMPTY, /* whether empty files are valid archives */ + ZIP_SOURCE_GET_FILE_ATTRIBUTES /* get additional file attributes */ +}; +typedef enum zip_source_cmd zip_source_cmd_t; + +#define ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd) (((zip_int64_t)1) << (cmd)) + +#define ZIP_SOURCE_CHECK_SUPPORTED(supported, cmd) (((supported) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd)) != 0) + +/* clang-format off */ + +#define ZIP_SOURCE_SUPPORTS_READABLE (ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_OPEN) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_READ) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_CLOSE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_STAT) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ERROR) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_FREE)) + +#define ZIP_SOURCE_SUPPORTS_SEEKABLE (ZIP_SOURCE_SUPPORTS_READABLE \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_TELL) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SUPPORTS)) + +#define ZIP_SOURCE_SUPPORTS_WRITABLE (ZIP_SOURCE_SUPPORTS_SEEKABLE \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_BEGIN_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_COMMIT_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ROLLBACK_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_TELL_WRITE) \ + | ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_REMOVE)) + +/* clang-format on */ + +/* for use by sources */ +struct zip_source_args_seek { + zip_int64_t offset; + int whence; +}; + +typedef struct zip_source_args_seek zip_source_args_seek_t; +#define ZIP_SOURCE_GET_ARGS(type, data, len, error) ((len) < sizeof(type) ? zip_error_set((error), ZIP_ER_INVAL, 0), (type *)NULL : (type *)(data)) + + +/* error information */ +/* use zip_error_*() to access */ +struct zip_error { + int zip_err; /* libzip error code (ZIP_ER_*) */ + int sys_err; /* copy of errno (E*) or zlib error code */ + char *_Nullable str; /* string representation or NULL */ +}; + +#define ZIP_STAT_NAME 0x0001u +#define ZIP_STAT_INDEX 0x0002u +#define ZIP_STAT_SIZE 0x0004u +#define ZIP_STAT_COMP_SIZE 0x0008u +#define ZIP_STAT_MTIME 0x0010u +#define ZIP_STAT_CRC 0x0020u +#define ZIP_STAT_COMP_METHOD 0x0040u +#define ZIP_STAT_ENCRYPTION_METHOD 0x0080u +#define ZIP_STAT_FLAGS 0x0100u + +struct zip_stat { + zip_uint64_t valid; /* which fields have valid values */ + const char *_Nullable name; /* name of the file */ + zip_uint64_t index; /* index within archive */ + zip_uint64_t size; /* size of file (uncompressed) */ + zip_uint64_t comp_size; /* size of file (compressed) */ + time_t mtime; /* modification time */ + zip_uint32_t crc; /* crc of file data */ + zip_uint16_t comp_method; /* compression method used */ + zip_uint16_t encryption_method; /* encryption method used */ + zip_uint32_t flags; /* reserved for future use */ +}; + +struct zip_buffer_fragment { + zip_uint8_t *_Nonnull data; + zip_uint64_t length; +}; + +struct zip_file_attributes { + zip_uint64_t valid; /* which fields have valid values */ + zip_uint8_t version; /* version of this struct, currently 1 */ + zip_uint8_t host_system; /* host system on which file was created */ + zip_uint8_t ascii; /* flag whether file is ASCII text */ + zip_uint8_t version_needed; /* minimum version needed to extract file */ + zip_uint32_t external_file_attributes; /* external file attributes (host-system specific) */ + zip_uint16_t general_purpose_bit_flags; /* general purpose big flags, only some bits are honored */ + zip_uint16_t general_purpose_bit_mask; /* which bits in general_purpose_bit_flags are valid */ +}; + +#define ZIP_FILE_ATTRIBUTES_HOST_SYSTEM 0x0001u +#define ZIP_FILE_ATTRIBUTES_ASCII 0x0002u +#define ZIP_FILE_ATTRIBUTES_VERSION_NEEDED 0x0004u +#define ZIP_FILE_ATTRIBUTES_EXTERNAL_FILE_ATTRIBUTES 0x0008u +#define ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS 0x0010u + +struct zip; +struct zip_file; +struct zip_source; + +typedef struct zip zip_t; +typedef struct zip_error zip_error_t; +typedef struct zip_file zip_file_t; +typedef struct zip_file_attributes zip_file_attributes_t; +typedef struct zip_source zip_source_t; +typedef struct zip_stat zip_stat_t; +typedef struct zip_buffer_fragment zip_buffer_fragment_t; + +typedef zip_uint32_t zip_flags_t; + +typedef zip_int64_t (*zip_source_callback)(void *_Nullable, void *_Nullable, zip_uint64_t, zip_source_cmd_t); +typedef void (*zip_progress_callback)(zip_t *_Nonnull, double, void *_Nullable); +typedef int (*zip_cancel_callback)(zip_t *_Nonnull, void *_Nullable); + +#ifndef ZIP_DISABLE_DEPRECATED +typedef void (*zip_progress_callback_t)(double); +ZIP_EXTERN void zip_register_progress_callback(zip_t *_Nonnull, zip_progress_callback_t _Nullable); /* use zip_register_progress_callback_with_state */ + +ZIP_EXTERN zip_int64_t zip_add(zip_t *_Nonnull, const char *_Nonnull, zip_source_t *_Nonnull); /* use zip_file_add */ +ZIP_EXTERN zip_int64_t zip_add_dir(zip_t *_Nonnull, const char *_Nonnull); /* use zip_dir_add */ +ZIP_EXTERN const char *_Nullable zip_get_file_comment(zip_t *_Nonnull, zip_uint64_t, int *_Nullable, int); /* use zip_file_get_comment */ +ZIP_EXTERN int zip_get_num_files(zip_t *_Nonnull); /* use zip_get_num_entries instead */ +ZIP_EXTERN int zip_rename(zip_t *_Nonnull, zip_uint64_t, const char *_Nonnull); /* use zip_file_rename */ +ZIP_EXTERN int zip_replace(zip_t *_Nonnull, zip_uint64_t, zip_source_t *_Nonnull); /* use zip_file_replace */ +ZIP_EXTERN int zip_set_file_comment(zip_t *_Nonnull, zip_uint64_t, const char *_Nullable, int); /* use zip_file_set_comment */ +ZIP_EXTERN int zip_error_get_sys_type(int); /* use zip_error_system_type */ +ZIP_EXTERN void zip_error_get(zip_t *_Nonnull, int *_Nullable, int *_Nullable); /* use zip_get_error, zip_error_code_zip / zip_error_code_system */ +ZIP_EXTERN int zip_error_to_str(char *_Nonnull, zip_uint64_t, int, int); /* use zip_error_init_with_code / zip_error_strerror */ +ZIP_EXTERN void zip_file_error_get(zip_file_t *_Nonnull, int *_Nullable, int *_Nullable); /* use zip_file_get_error, zip_error_code_zip / zip_error_code_system */ +#endif + +ZIP_EXTERN int zip_close(zip_t *_Nonnull); +ZIP_EXTERN int zip_delete(zip_t *_Nonnull, zip_uint64_t); +ZIP_EXTERN zip_int64_t zip_dir_add(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t); +ZIP_EXTERN void zip_discard(zip_t *_Nonnull); + +ZIP_EXTERN zip_error_t *_Nonnull zip_get_error(zip_t *_Nonnull); +ZIP_EXTERN void zip_error_clear(zip_t *_Nonnull); +ZIP_EXTERN int zip_error_code_zip(const zip_error_t *_Nonnull); +ZIP_EXTERN int zip_error_code_system(const zip_error_t *_Nonnull); +ZIP_EXTERN void zip_error_fini(zip_error_t *_Nonnull); +ZIP_EXTERN void zip_error_init(zip_error_t *_Nonnull); +ZIP_EXTERN void zip_error_init_with_code(zip_error_t *_Nonnull, int); +ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int); +ZIP_EXTERN const char *_Nonnull zip_error_strerror(zip_error_t *_Nonnull); +ZIP_EXTERN int zip_error_system_type(const zip_error_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_error_to_data(const zip_error_t *_Nonnull, void *_Nonnull, zip_uint64_t); + +ZIP_EXTERN int zip_fclose(zip_file_t *_Nonnull); +ZIP_EXTERN zip_t *_Nullable zip_fdopen(int, int, int *_Nullable); +ZIP_EXTERN zip_int64_t zip_file_add(zip_t *_Nonnull, const char *_Nonnull, zip_source_t *_Nonnull, zip_flags_t); +ZIP_EXTERN void zip_file_attributes_init(zip_file_attributes_t *_Nonnull); +ZIP_EXTERN void zip_file_error_clear(zip_file_t *_Nonnull); +ZIP_EXTERN int zip_file_extra_field_delete(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_flags_t); +ZIP_EXTERN int zip_file_extra_field_delete_by_id(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_flags_t); +ZIP_EXTERN int zip_file_extra_field_set(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, const zip_uint8_t *_Nullable, zip_uint16_t, zip_flags_t); +ZIP_EXTERN zip_int16_t zip_file_extra_fields_count(zip_t *_Nonnull, zip_uint64_t, zip_flags_t); +ZIP_EXTERN zip_int16_t zip_file_extra_fields_count_by_id(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_flags_t); +ZIP_EXTERN const zip_uint8_t *_Nullable zip_file_extra_field_get(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t *_Nullable, zip_uint16_t *_Nullable, zip_flags_t); +ZIP_EXTERN const zip_uint8_t *_Nullable zip_file_extra_field_get_by_id(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_uint16_t *_Nullable, zip_flags_t); +ZIP_EXTERN const char *_Nullable zip_file_get_comment(zip_t *_Nonnull, zip_uint64_t, zip_uint32_t *_Nullable, zip_flags_t); +ZIP_EXTERN zip_error_t *_Nonnull zip_file_get_error(zip_file_t *_Nonnull); +ZIP_EXTERN int zip_file_get_external_attributes(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint8_t *_Nullable, zip_uint32_t *_Nullable); +ZIP_EXTERN int zip_file_is_seekable(zip_file_t *_Nonnull); +ZIP_EXTERN int zip_file_rename(zip_t *_Nonnull, zip_uint64_t, const char *_Nonnull, zip_flags_t); +ZIP_EXTERN int zip_file_replace(zip_t *_Nonnull, zip_uint64_t, zip_source_t *_Nonnull, zip_flags_t); +ZIP_EXTERN int zip_file_set_comment(zip_t *_Nonnull, zip_uint64_t, const char *_Nullable, zip_uint16_t, zip_flags_t); +ZIP_EXTERN int zip_file_set_dostime(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, zip_uint16_t, zip_flags_t); +ZIP_EXTERN int zip_file_set_encryption(zip_t *_Nonnull, zip_uint64_t, zip_uint16_t, const char *_Nullable); +ZIP_EXTERN int zip_file_set_external_attributes(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint8_t, zip_uint32_t); +ZIP_EXTERN int zip_file_set_mtime(zip_t *_Nonnull, zip_uint64_t, time_t, zip_flags_t); +ZIP_EXTERN const char *_Nonnull zip_file_strerror(zip_file_t *_Nonnull); +ZIP_EXTERN zip_file_t *_Nullable zip_fopen(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t); +ZIP_EXTERN zip_file_t *_Nullable zip_fopen_encrypted(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t, const char *_Nullable); +ZIP_EXTERN zip_file_t *_Nullable zip_fopen_index(zip_t *_Nonnull, zip_uint64_t, zip_flags_t); +ZIP_EXTERN zip_file_t *_Nullable zip_fopen_index_encrypted(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, const char *_Nullable); +ZIP_EXTERN zip_int64_t zip_fread(zip_file_t *_Nonnull, void *_Nonnull, zip_uint64_t); +ZIP_EXTERN zip_int8_t zip_fseek(zip_file_t *_Nonnull, zip_int64_t, int); +ZIP_EXTERN zip_int64_t zip_ftell(zip_file_t *_Nonnull); +ZIP_EXTERN const char *_Nullable zip_get_archive_comment(zip_t *_Nonnull, int *_Nullable, zip_flags_t); +ZIP_EXTERN int zip_get_archive_flag(zip_t *_Nonnull, zip_flags_t, zip_flags_t); +ZIP_EXTERN const char *_Nullable zip_get_name(zip_t *_Nonnull, zip_uint64_t, zip_flags_t); +ZIP_EXTERN zip_int64_t zip_get_num_entries(zip_t *_Nonnull, zip_flags_t); +ZIP_EXTERN const char *_Nonnull zip_libzip_version(void); +ZIP_EXTERN zip_int64_t zip_name_locate(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t); +ZIP_EXTERN zip_t *_Nullable zip_open(const char *_Nonnull, int, int *_Nullable); +ZIP_EXTERN zip_t *_Nullable zip_open_from_source(zip_source_t *_Nonnull, int, zip_error_t *_Nullable); +ZIP_EXTERN int zip_register_progress_callback_with_state(zip_t *_Nonnull, double, zip_progress_callback _Nullable, void (*_Nullable)(void *_Nullable), void *_Nullable); +ZIP_EXTERN int zip_register_cancel_callback_with_state(zip_t *_Nonnull, zip_cancel_callback _Nullable, void (*_Nullable)(void *_Nullable), void *_Nullable); +ZIP_EXTERN int zip_set_archive_comment(zip_t *_Nonnull, const char *_Nullable, zip_uint16_t); +ZIP_EXTERN int zip_set_archive_flag(zip_t *_Nonnull, zip_flags_t, int); +ZIP_EXTERN int zip_set_default_password(zip_t *_Nonnull, const char *_Nullable); +ZIP_EXTERN int zip_set_file_compression(zip_t *_Nonnull, zip_uint64_t, zip_int32_t, zip_uint32_t); +ZIP_EXTERN int zip_source_begin_write(zip_source_t *_Nonnull); +ZIP_EXTERN int zip_source_begin_write_cloning(zip_source_t *_Nonnull, zip_uint64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer(zip_t *_Nonnull, const void *_Nullable, zip_uint64_t, int); +ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_create(const void *_Nullable, zip_uint64_t, int, zip_error_t *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_fragment(zip_t *_Nonnull, const zip_buffer_fragment_t *_Nonnull, zip_uint64_t, int); +ZIP_EXTERN zip_source_t *_Nullable zip_source_buffer_fragment_create(const zip_buffer_fragment_t *_Nullable, zip_uint64_t, int, zip_error_t *_Nullable); +ZIP_EXTERN int zip_source_close(zip_source_t *_Nonnull); +ZIP_EXTERN int zip_source_commit_write(zip_source_t *_Nonnull); +ZIP_EXTERN zip_error_t *_Nonnull zip_source_error(zip_source_t *_Nonnull); +ZIP_EXTERN zip_source_t *_Nullable zip_source_file(zip_t *_Nonnull, const char *_Nonnull, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_file_create(const char *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_filep(zip_t *_Nonnull, FILE *_Nonnull, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_filep_create(FILE *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN void zip_source_free(zip_source_t *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_function(zip_t *_Nonnull, zip_source_callback _Nonnull, void *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_function_create(zip_source_callback _Nonnull, void *_Nullable, zip_error_t *_Nullable); +ZIP_EXTERN int zip_source_get_file_attributes(zip_source_t *_Nonnull, zip_file_attributes_t *_Nonnull); +ZIP_EXTERN int zip_source_is_deleted(zip_source_t *_Nonnull); +ZIP_EXTERN void zip_source_keep(zip_source_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_source_make_command_bitmap(zip_source_cmd_t, ...); +ZIP_EXTERN int zip_source_open(zip_source_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_source_read(zip_source_t *_Nonnull, void *_Nonnull, zip_uint64_t); +ZIP_EXTERN void zip_source_rollback_write(zip_source_t *_Nonnull); +ZIP_EXTERN int zip_source_seek(zip_source_t *_Nonnull, zip_int64_t, int); +ZIP_EXTERN zip_int64_t zip_source_seek_compute_offset(zip_uint64_t, zip_uint64_t, void *_Nonnull, zip_uint64_t, zip_error_t *_Nullable); +ZIP_EXTERN int zip_source_seek_write(zip_source_t *_Nonnull, zip_int64_t, int); +ZIP_EXTERN int zip_source_stat(zip_source_t *_Nonnull, zip_stat_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_source_tell(zip_source_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_source_tell_write(zip_source_t *_Nonnull); +#ifdef _WIN32 +ZIP_EXTERN zip_source_t *zip_source_win32a(zip_t *, const char *, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *zip_source_win32a_create(const char *, zip_uint64_t, zip_int64_t, zip_error_t *); +ZIP_EXTERN zip_source_t *zip_source_win32handle(zip_t *, void *, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *zip_source_win32handle_create(void *, zip_uint64_t, zip_int64_t, zip_error_t *); +ZIP_EXTERN zip_source_t *zip_source_win32w(zip_t *, const wchar_t *, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *zip_source_win32w_create(const wchar_t *, zip_uint64_t, zip_int64_t, zip_error_t *); +#endif +ZIP_EXTERN zip_source_t *_Nullable zip_source_window_create(zip_source_t *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN zip_int64_t zip_source_write(zip_source_t *_Nonnull, const void *_Nullable, zip_uint64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_zip(zip_t *_Nonnull, zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_zip_create(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN int zip_stat(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t, zip_stat_t *_Nonnull); +ZIP_EXTERN int zip_stat_index(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_stat_t *_Nonnull); +ZIP_EXTERN void zip_stat_init(zip_stat_t *_Nonnull); +ZIP_EXTERN const char *_Nonnull zip_strerror(zip_t *_Nonnull); +ZIP_EXTERN int zip_unchange(zip_t *_Nonnull, zip_uint64_t); +ZIP_EXTERN int zip_unchange_all(zip_t *_Nonnull); +ZIP_EXTERN int zip_unchange_archive(zip_t *_Nonnull); +ZIP_EXTERN int zip_compression_method_supported(zip_int32_t method, int compress); +ZIP_EXTERN int zip_encryption_method_supported(zip_uint16_t method, int encode); + +#ifdef __cplusplus +} +#endif + +#endif /* _HAD_ZIP_H */ diff --git a/include/libzip/include/zipconf.h b/include/libzip/include/zipconf.h new file mode 100644 index 000000000..8c03513a5 --- /dev/null +++ b/include/libzip/include/zipconf.h @@ -0,0 +1,51 @@ +#ifndef _HAD_ZIPCONF_H +#define _HAD_ZIPCONF_H + +/* + zipconf.h -- platform specific include file + + This file was generated automatically by CMake + based on ../cmake-zipconf.h.in. + */ + +#define LIBZIP_VERSION "1.9.2" +#define LIBZIP_VERSION_MAJOR 1 +#define LIBZIP_VERSION_MINOR 9 +#define LIBZIP_VERSION_MICRO 2 + +/* #undef ZIP_STATIC */ + +#define _Nullable +#define _Nonnull + +#if !defined(__STDC_FORMAT_MACROS) +#define __STDC_FORMAT_MACROS 1 +#endif +#include + +typedef int8_t zip_int8_t; +typedef uint8_t zip_uint8_t; +typedef int16_t zip_int16_t; +typedef uint16_t zip_uint16_t; +typedef int32_t zip_int32_t; +typedef uint32_t zip_uint32_t; +typedef int64_t zip_int64_t; +typedef uint64_t zip_uint64_t; + +#define ZIP_INT8_MIN (-ZIP_INT8_MAX-1) +#define ZIP_INT8_MAX 0x7f +#define ZIP_UINT8_MAX 0xff + +#define ZIP_INT16_MIN (-ZIP_INT16_MAX-1) +#define ZIP_INT16_MAX 0x7fff +#define ZIP_UINT16_MAX 0xffff + +#define ZIP_INT32_MIN (-ZIP_INT32_MAX-1L) +#define ZIP_INT32_MAX 0x7fffffffL +#define ZIP_UINT32_MAX 0xffffffffLU + +#define ZIP_INT64_MIN (-ZIP_INT64_MAX-1LL) +#define ZIP_INT64_MAX 0x7fffffffffffffffLL +#define ZIP_UINT64_MAX 0xffffffffffffffffULL + +#endif /* zipconf.h */ diff --git a/include/libzip/include/zlib.h b/include/libzip/include/zlib.h new file mode 100644 index 000000000..953cb5012 --- /dev/null +++ b/include/libzip/include/zlib.h @@ -0,0 +1,1935 @@ +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.13, October 13th, 2022 + + Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + The data format used by the zlib library is described by RFCs (Request for + Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 + (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). +*/ + +#ifndef ZLIB_H +#define ZLIB_H + +#include "zconf.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ZLIB_VERSION "1.2.13" +#define ZLIB_VERNUM 0x12d0 +#define ZLIB_VER_MAJOR 1 +#define ZLIB_VER_MINOR 2 +#define ZLIB_VER_REVISION 13 +#define ZLIB_VER_SUBREVISION 0 + +/* + The 'zlib' compression library provides in-memory compression and + decompression functions, including integrity checks of the uncompressed data. + This version of the library supports only one compression method (deflation) + but other algorithms will be added later and will have the same stream + interface. + + Compression can be done in a single step if the buffers are large enough, + or can be done by repeated calls of the compression function. In the latter + case, the application must provide more input and/or consume the output + (providing more output space) before each call. + + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. + + The library also supports reading and writing files in gzip (.gz) format + with an interface similar to that of stdio using the functions that start + with "gz". The gzip format is different from the zlib format. gzip is a + gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + + This library can optionally read and write gzip and raw deflate streams in + memory as well. + + The zlib format was designed to be compact and fast for use in memory + and on communications channels. The gzip format was designed for single- + file compression on file systems, has a larger header than zlib to maintain + directory information, and uses a different, slower check method than zlib. + + The library does not install any signal handler. The decoder checks + the consistency of the compressed data, so the library should never crash + even in the case of corrupted input. +*/ + +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); +typedef void (*free_func) OF((voidpf opaque, voidpf address)); + +struct internal_state; + +typedef struct z_stream_s { + z_const Bytef *next_in; /* next input byte */ + uInt avail_in; /* number of bytes available at next_in */ + uLong total_in; /* total number of input bytes read so far */ + + Bytef *next_out; /* next output byte will go here */ + uInt avail_out; /* remaining free space at next_out */ + uLong total_out; /* total number of bytes output so far */ + + z_const char *msg; /* last error message, NULL if no error */ + struct internal_state FAR *state; /* not visible by applications */ + + alloc_func zalloc; /* used to allocate the internal state */ + free_func zfree; /* used to free the internal state */ + voidpf opaque; /* private data object passed to zalloc and zfree */ + + int data_type; /* best guess about the data type: binary or text + for deflate, or the decoding state for inflate */ + uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ + uLong reserved; /* reserved for future use */ +} z_stream; + +typedef z_stream FAR *z_streamp; + +/* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. +*/ +typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ +} gz_header; + +typedef gz_header FAR *gz_headerp; + +/* + The application must update next_in and avail_in when avail_in has dropped + to zero. It must update next_out and avail_out when avail_out has dropped + to zero. The application must initialize zalloc, zfree and opaque before + calling the init function. All other fields are set by the compression + library and must not be updated by the application. + + The opaque value provided by the application will be passed as the first + parameter for calls of zalloc and zfree. This can be useful for custom + memory management. The compression library attaches no meaning to the + opaque value. + + zalloc must return Z_NULL if there is not enough memory for the object. + If zlib is used in a multi-threaded application, zalloc and zfree must be + thread safe. In that case, zlib is thread-safe. When zalloc and zfree are + Z_NULL on entry to the initialization function, they are set to internal + routines that use the standard library functions malloc() and free(). + + On 16-bit systems, the functions zalloc and zfree must be able to allocate + exactly 65536 bytes, but will not be required to allocate more than this if + the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers + returned by zalloc for objects of exactly 65536 bytes *must* have their + offset normalized to zero. The default allocation function provided by this + library ensures this (see zutil.c). To reduce memory requirements and avoid + any allocation of 64K objects, at the expense of compression ratio, compile + the library with -DMAX_WBITS=14 (see zconf.h). + + The fields total_in and total_out can be used for statistics or progress + reports. After compression, total_in holds the total size of the + uncompressed data and may be saved for use by the decompressor (particularly + if the decompressor wants to decompress everything in a single step). +*/ + + /* constants */ + +#define Z_NO_FLUSH 0 +#define Z_PARTIAL_FLUSH 1 +#define Z_SYNC_FLUSH 2 +#define Z_FULL_FLUSH 3 +#define Z_FINISH 4 +#define Z_BLOCK 5 +#define Z_TREES 6 +/* Allowed flush values; see deflate() and inflate() below for details */ + +#define Z_OK 0 +#define Z_STREAM_END 1 +#define Z_NEED_DICT 2 +#define Z_ERRNO (-1) +#define Z_STREAM_ERROR (-2) +#define Z_DATA_ERROR (-3) +#define Z_MEM_ERROR (-4) +#define Z_BUF_ERROR (-5) +#define Z_VERSION_ERROR (-6) +/* Return codes for the compression/decompression functions. Negative values + * are errors, positive values are used for special but normal events. + */ + +#define Z_NO_COMPRESSION 0 +#define Z_BEST_SPEED 1 +#define Z_BEST_COMPRESSION 9 +#define Z_DEFAULT_COMPRESSION (-1) +/* compression levels */ + +#define Z_FILTERED 1 +#define Z_HUFFMAN_ONLY 2 +#define Z_RLE 3 +#define Z_FIXED 4 +#define Z_DEFAULT_STRATEGY 0 +/* compression strategy; see deflateInit2() below for details */ + +#define Z_BINARY 0 +#define Z_TEXT 1 +#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ +#define Z_UNKNOWN 2 +/* Possible values of the data_type field for deflate() */ + +#define Z_DEFLATED 8 +/* The deflate compression method (the only one supported in this version) */ + +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ + +#define zlib_version zlibVersion() +/* for compatibility with versions < 1.0.2 */ + + + /* basic functions */ + +ZEXTERN const char * ZEXPORT zlibVersion OF((void)); +/* The application can compare zlibVersion and ZLIB_VERSION for consistency. + If the first character differs, the library code actually used is not + compatible with the zlib.h header file used by the application. This check + is automatically made by deflateInit and inflateInit. + */ + +/* +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); + + Initializes the internal stream state for compression. The fields + zalloc, zfree and opaque must be initialized before by the caller. If + zalloc and zfree are set to Z_NULL, deflateInit updates them to use default + allocation functions. + + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: + 1 gives best speed, 9 gives best compression, 0 gives no compression at all + (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION + requests a default compromise between speed and compression (currently + equivalent to level 6). + + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if level is not a valid compression level, or + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible + with the version assumed by the caller (ZLIB_VERSION). msg is set to null + if there is no error message. deflateInit does not perform any compression: + this will be done by deflate(). +*/ + + +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); +/* + deflate compresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. deflate performs one or both of the + following actions: + + - Compress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), next_in and avail_in are updated and + processing will resume at this point for the next call of deflate(). + + - Generate more output starting at next_out and update next_out and avail_out + accordingly. This action is forced if the parameter flush is non zero. + Forcing flush frequently degrades the compression ratio, so this parameter + should be set only when necessary. Some output may be provided even if + flush is zero. + + Before the call of deflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating avail_in or avail_out accordingly; avail_out should + never be zero before the call. The application can consume the compressed + output when it wants, for example when the output buffer is full (avail_out + == 0), or after each call of deflate(). If deflate returns Z_OK and with + zero avail_out, it must be called again after making room in the output + buffer because there might be more output pending. See deflatePending(), + which can be used if desired to determine whether or not there is more output + in that case. + + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumulate before producing output, in order to + maximize compression. + + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is + flushed to the output buffer and the output is aligned on a byte boundary, so + that the decompressor can get all input data available so far. (In + particular avail_in is zero after the call if enough output space has been + provided before the call.) Flushing may degrade compression for some + compression algorithms and so it should be used only when necessary. This + completes the current deflate block and follows it with an empty stored block + that is three bits plus filler bits to the next byte, followed by four bytes + (00 00 ff ff). + + If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the + output buffer, but the output is not aligned to a byte boundary. All of the + input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. + This completes the current deflate block and follows it with an empty fixed + codes block that is 10 bits long. This assures that enough bytes are output + in order for the decompressor to finish the block before the empty fixed + codes block. + + If flush is set to Z_BLOCK, a deflate block is completed and emitted, as + for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to + seven bits of the current block are held to be written as the next byte after + the next deflate block is completed. In this case, the decompressor may not + be provided enough bits at this point in order to complete decompression of + the data provided so far to the compressor. It may need to wait for the next + block to be emitted. This is for advanced applications that need to control + the emission of deflate blocks. + + If flush is set to Z_FULL_FLUSH, all output is flushed as with + Z_SYNC_FLUSH, and the compression state is reset so that decompression can + restart from this point if previous compressed data has been damaged or if + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade + compression. + + If deflate returns with avail_out == 0, this function must be called again + with the same value of the flush parameter and more output space (updated + avail_out), until the flush is complete (deflate returns with non-zero + avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that + avail_out is greater than six to avoid repeated flush markers due to + avail_out == 0 on return. + + If the parameter flush is set to Z_FINISH, pending input is processed, + pending output is flushed and deflate returns with Z_STREAM_END if there was + enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this + function must be called again with Z_FINISH and more output space (updated + avail_out) but no more input data, until it returns with Z_STREAM_END or an + error. After deflate has returned Z_STREAM_END, the only possible operations + on the stream are deflateReset or deflateEnd. + + Z_FINISH can be used in the first deflate call after deflateInit if all the + compression is to be done in a single step. In order to complete in one + call, avail_out must be at least the value returned by deflateBound (see + below). Then deflate is guaranteed to return Z_STREAM_END. If not enough + output space is provided, deflate will not return Z_STREAM_END, and it must + be called again as described above. + + deflate() sets strm->adler to the Adler-32 checksum of all input read + so far (that is, total_in bytes). If a gzip stream is being generated, then + strm->adler will be the CRC-32 checksum of the input read so far. (See + deflateInit2 below.) + + deflate() may update strm->data_type if it can make a good guess about + the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is + considered binary. This field is only for information purposes and does not + affect the compression algorithm in any manner. + + deflate() returns Z_OK if some progress has been made (more input + processed or more output produced), Z_STREAM_END if all input has been + consumed and all output has been produced (only when flush is set to + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example + if next_in or next_out was Z_NULL or the state was inadvertently written over + by the application), or Z_BUF_ERROR if no progress is possible (for example + avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and + deflate() can be called again with more input and more output space to + continue compressing. +*/ + + +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the + stream state was inconsistent, Z_DATA_ERROR if the stream was freed + prematurely (some input or output was discarded). In the error case, msg + may be set but then points to a static string (which must not be + deallocated). +*/ + + +/* +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); + + Initializes the internal stream state for decompression. The fields + next_in, avail_in, zalloc, zfree and opaque must be initialized before by + the caller. In the current version of inflate, the provided input is not + read or consumed. The allocation of a sliding window will be deferred to + the first call of inflate (if the decompression does not complete on the + first call). If zalloc and zfree are set to Z_NULL, inflateInit updates + them to use default allocation functions. + + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit does not perform any decompression. + Actual decompression will be done by inflate(). So next_in, and avail_in, + next_out, and avail_out are unused and unchanged. The current + implementation of inflateInit() does not process any header information -- + that is deferred until inflate() is called. +*/ + + +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +/* + inflate decompresses as much data as possible, and stops when the input + buffer becomes empty or the output buffer becomes full. It may introduce + some output latency (reading input without producing any output) except when + forced to flush. + + The detailed semantics are as follows. inflate performs one or both of the + following actions: + + - Decompress more input starting at next_in and update next_in and avail_in + accordingly. If not all input can be processed (because there is not + enough room in the output buffer), then next_in and avail_in are updated + accordingly, and processing will resume at this point for the next call of + inflate(). + + - Generate more output starting at next_out and update next_out and avail_out + accordingly. inflate() provides as much output as possible, until there is + no more input data or no more space in the output buffer (see below about + the flush parameter). + + Before the call of inflate(), the application should ensure that at least + one of the actions is possible, by providing more input and/or consuming more + output, and updating the next_* and avail_* values accordingly. If the + caller of inflate() does not provide both available input and available + output space, it is possible that there will be no progress made. The + application can consume the uncompressed output when it wants, for example + when the output buffer is full (avail_out == 0), or after each call of + inflate(). If inflate returns Z_OK and with zero avail_out, it must be + called again after making room in the output buffer because there might be + more output pending. + + The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, + Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much + output as possible to the output buffer. Z_BLOCK requests that inflate() + stop if and when it gets to the next deflate block boundary. When decoding + the zlib or gzip format, this will cause inflate() to return immediately + after the header and before the first block. When doing a raw inflate, + inflate() will go ahead and process the first block, and will return when it + gets to the end of that block, or when it runs out of data. + + The Z_BLOCK option assists in appending to or combining deflate streams. + To assist in this, on return inflate() always sets strm->data_type to the + number of unused bits in the last byte taken from strm->next_in, plus 64 if + inflate() is currently decoding the last block in the deflate stream, plus + 128 if inflate() returned immediately after decoding an end-of-block code or + decoding the complete header up to just before the first byte of the deflate + stream. The end-of-block will not be indicated until all of the uncompressed + data from that block has been written to strm->next_out. The number of + unused bits may in general be greater than seven, except when bit 7 of + data_type is set, in which case the number of unused bits will be less than + eight. data_type is set as noted here every time inflate() returns for all + flush options, and so can be used to determine the amount of currently + consumed input in bits. + + The Z_TREES option behaves as Z_BLOCK does, but it also returns when the + end of each deflate block header is reached, before any actual data in that + block is decoded. This allows the caller to determine the length of the + deflate block header for later use in random access within a deflate block. + 256 is added to the value of strm->data_type when inflate() returns + immediately after reaching the end of the deflate block header. + + inflate() should normally be called until it returns Z_STREAM_END or an + error. However if all decompression is to be performed in a single step (a + single call of inflate), the parameter flush should be set to Z_FINISH. In + this case all pending input is processed and all pending output is flushed; + avail_out must be large enough to hold all of the uncompressed data for the + operation to complete. (The size of the uncompressed data may have been + saved by the compressor for this purpose.) The use of Z_FINISH is not + required to perform an inflation in one step. However it may be used to + inform inflate that a faster approach can be used for the single inflate() + call. Z_FINISH also informs inflate to not maintain a sliding window if the + stream completes, which reduces inflate's memory footprint. If the stream + does not complete, either because not all of the stream is provided or not + enough output space is provided, then a sliding window will be allocated and + inflate() can be called again to continue the operation as if Z_NO_FLUSH had + been used. + + In this implementation, inflate() always flushes as much output as + possible to the output buffer, and always uses the faster approach on the + first call. So the effects of the flush parameter in this implementation are + on the return value of inflate() as noted below, when inflate() returns early + when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of + memory for a sliding window when Z_FINISH is used. + + If a preset dictionary is needed after this call (see inflateSetDictionary + below), inflate sets strm->adler to the Adler-32 checksum of the dictionary + chosen by the compressor and returns Z_NEED_DICT; otherwise it sets + strm->adler to the Adler-32 checksum of all output produced so far (that is, + total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described + below. At the end of the stream, inflate() checks that its computed Adler-32 + checksum is equal to that saved by the compressor and returns Z_STREAM_END + only if the checksum is correct. + + inflate() can decompress and check either zlib-wrapped or gzip-wrapped + deflate data. The header type is detected automatically, if requested when + initializing with inflateInit2(). Any information contained in the gzip + header is not retained unless inflateGetHeader() is used. When processing + gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output + produced so far. The CRC-32 is checked against the gzip trailer, as is the + uncompressed length, modulo 2^32. + + inflate() returns Z_OK if some progress has been made (more input processed + or more output produced), Z_STREAM_END if the end of the compressed data has + been reached and all uncompressed output has been produced, Z_NEED_DICT if a + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was + corrupted (input stream not conforming to the zlib format or incorrect check + value, in which case strm->msg points to a string with a more specific + error), Z_STREAM_ERROR if the stream structure was inconsistent (for example + next_in or next_out was Z_NULL, or the state was inadvertently written over + by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR + if no progress was possible or if there was not enough room in the output + buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + inflate() can be called again with more input and more output space to + continue decompressing. If Z_DATA_ERROR is returned, the application may + then call inflateSync() to look for a good compression block if a partial + recovery of the data is to be attempted. +*/ + + +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +/* + All dynamically allocated data structures for this stream are freed. + This function discards any unprocessed input and does not flush any pending + output. + + inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state + was inconsistent. +*/ + + + /* Advanced functions */ + +/* + The following functions are needed only in some special applications. +*/ + +/* +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, + int level, + int method, + int windowBits, + int memLevel, + int strategy)); + + This is another version of deflateInit with more compression options. The + fields zalloc, zfree and opaque must be initialized before by the caller. + + The method parameter is the compression method. It must be Z_DEFLATED in + this version of the library. + + The windowBits parameter is the base two logarithm of the window size + (the size of the history buffer). It should be in the range 8..15 for this + version of the library. Larger values of this parameter result in better + compression at the expense of memory usage. The default value is 15 if + deflateInit is used instead. + + For the current implementation of deflate(), a windowBits value of 8 (a + window size of 256 bytes) is not supported. As a result, a request for 8 + will result in 9 (a 512-byte window). In that case, providing 8 to + inflateInit2() will result in an error when the zlib header with 9 is + checked against the initialization of inflate(). The remedy is to not use 8 + with deflateInit2() with this initialization, or at least in that case use 9 + with inflateInit2(). + + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits + determines the window size. deflate() will then generate raw deflate data + with no zlib header or trailer, and will not compute a check value. + + windowBits can also be greater than 15 for optional gzip encoding. Add + 16 to windowBits to write a simple gzip header and trailer around the + compressed data instead of a zlib wrapper. The gzip header will have no + file name, no extra data, no comment, no modification time (set to zero), no + header crc, and the operating system will be set to the appropriate value, + if the operating system was determined at compile time. If a gzip stream is + being written, strm->adler is a CRC-32 instead of an Adler-32. + + For raw deflate or gzip encoding, a request for a 256-byte window is + rejected as invalid, since only the zlib header provides a means of + transmitting the window size to the decompressor. + + The memLevel parameter specifies how much memory should be allocated + for the internal compression state. memLevel=1 uses minimum memory but is + slow and reduces compression ratio; memLevel=9 uses maximum memory for + optimal speed. The default value is 8. See zconf.h for total memory usage + as a function of windowBits and memLevel. + + The strategy parameter is used to tune the compression algorithm. Use the + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a + filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no + string match), or Z_RLE to limit match distances to one (run-length + encoding). Filtered data consists mostly of small values with a somewhat + random distribution. In this case, the compression algorithm is tuned to + compress them better. The effect of Z_FILTERED is to force more Huffman + coding and less string matching; it is somewhat intermediate between + Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as + fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The + strategy parameter only affects the compression ratio but not the + correctness of the compressed output even if it is not set appropriately. + Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler + decoder for special applications. + + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid + method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is + incompatible with the version assumed by the caller (ZLIB_VERSION). msg is + set to null if there is no error message. deflateInit2 does not perform any + compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the compression dictionary from the given byte sequence + without producing any compressed output. When using the zlib format, this + function must be called immediately after deflateInit, deflateInit2 or + deflateReset, and before any call of deflate. When doing raw deflate, this + function must be called either before any call of deflate, or immediately + after the completion of a deflate block, i.e. after all input has been + consumed and all output has been delivered when using any of the flush + options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The + compressor and decompressor must use exactly the same dictionary (see + inflateSetDictionary). + + The dictionary should consist of strings (byte sequences) that are likely + to be encountered later in the data to be compressed, with the most commonly + used strings preferably put towards the end of the dictionary. Using a + dictionary is most useful when the data to be compressed is short and can be + predicted with good accuracy; the data can then be compressed better than + with the default empty dictionary. + + Depending on the size of the compression data structures selected by + deflateInit or deflateInit2, a part of the dictionary may in effect be + discarded, for example if the dictionary is larger than the window size + provided in deflateInit or deflateInit2. Thus the strings most likely to be + useful should be put at the end of the dictionary, not at the front. In + addition, the current implementation of deflate will use at most the window + size minus 262 bytes of the provided dictionary. + + Upon return of this function, strm->adler is set to the Adler-32 value + of the dictionary; the decompressor may later use this value to determine + which dictionary has been used by the compressor. (The Adler-32 value + applies to the whole dictionary even if only a subset of the dictionary is + actually used by the compressor.) If a raw deflate was requested, then the + Adler-32 value is not computed and strm->adler is not set. + + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent (for example if deflate has already been called for this stream + or if not at a block boundary for raw deflate). deflateSetDictionary does + not perform any compression: this will be done by deflate(). +*/ + +ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by deflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If deflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similarly, if dictLength is Z_NULL, then it is not set. + + deflateGetDictionary() may return a length less than the window size, even + when more than the window size in input has been provided. It may return up + to 258 bytes less in that case, due to how zlib's implementation of deflate + manages the sliding window and lookahead for matches, where matches can be + up to 258 bytes long. If the application needs the last window-size bytes of + input, then that would need to be saved by the application outside of zlib. + + deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when several compression strategies will be + tried, for example when there are several ways of pre-processing the input + data with a filter. The streams that will be discarded should then be freed + by calling deflateEnd. Note that deflateCopy duplicates the internal + compression state which can be quite large, so this strategy is slow and can + consume lots of memory. + + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); +/* + This function is equivalent to deflateEnd followed by deflateInit, but + does not free and reallocate the internal compression state. The stream + will leave the compression level and any other attributes that may have been + set unchanged. + + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, + int level, + int strategy)); +/* + Dynamically update the compression level and compression strategy. The + interpretation of level and strategy is as in deflateInit2(). This can be + used to switch between compression and straight copy of the input data, or + to switch to a different kind of input data requiring a different strategy. + If the compression approach (which is a function of the level) or the + strategy is changed, and if there have been any deflate() calls since the + state was initialized or reset, then the input available so far is + compressed with the old level and strategy using deflate(strm, Z_BLOCK). + There are three approaches for the compression levels 0, 1..3, and 4..9 + respectively. The new level and strategy will take effect at the next call + of deflate(). + + If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does + not have enough output space to complete, then the parameter change will not + take effect. In this case, deflateParams() can be called again with the + same parameters and more output space to try again. + + In order to assure a change in the parameters on the first try, the + deflate stream should be flushed using deflate() with Z_BLOCK or other flush + request until strm.avail_out is not zero, before calling deflateParams(). + Then no more input data should be provided before the deflateParams() call. + If this is done, the old level and strategy will be applied to the data + compressed before deflateParams(), and the new level and strategy will be + applied to the the data compressed after deflateParams(). + + deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream + state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if + there was not enough output space to complete the compression of the + available input data before a change in the strategy or approach. Note that + in the case of a Z_BUF_ERROR, the parameters are not changed. A return + value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be + retried with more output space. +*/ + +ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); +/* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + +ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, + uLong sourceLen)); +/* + deflateBound() returns an upper bound on the compressed size after + deflation of sourceLen bytes. It must be called after deflateInit() or + deflateInit2(), and after deflateSetHeader(), if used. This would be used + to allocate an output buffer for deflation in a single pass, and so would be + called before deflate(). If that first deflate() call is provided the + sourceLen input bytes, an output buffer allocated to the size returned by + deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed + to return Z_STREAM_END. Note that it is possible for the compressed size to + be larger than the value returned by deflateBound() if flush options other + than Z_FINISH or Z_NO_FLUSH are used. +*/ + +ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm, + unsigned *pending, + int *bits)); +/* + deflatePending() returns the number of bytes and bits of output that have + been generated, but not yet provided in the available output. The bytes not + provided would be due to the available output space having being consumed. + The number of bits of output not provided are between 0 and 7, where they + await more bits to join them in order to fill out a full byte. If pending + or bits are Z_NULL, then those values are not set. + + deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. + */ + +ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + deflatePrime() inserts bits in the deflate output stream. The intent + is that this function is used to start off the deflate output with the bits + leftover from a previous deflate stream when appending to it. As such, this + function can only be used for raw deflate, and must be used before the first + deflate() call after a deflateInit2() or deflateReset(). bits must be less + than or equal to 16, and that many of the least significant bits of value + will be inserted in the output. + + deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough + room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); +/* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, + int windowBits)); + + This is another version of inflateInit with an extra parameter. The + fields next_in, avail_in, zalloc, zfree and opaque must be initialized + before by the caller. + + The windowBits parameter is the base two logarithm of the maximum window + size (the size of the history buffer). It should be in the range 8..15 for + this version of the library. The default value is 15 if inflateInit is used + instead. windowBits must be greater than or equal to the windowBits value + provided to deflateInit2() while compressing, or it must be equal to 15 if + deflateInit2() was not used. If a compressed stream with a larger window + size is given as input, inflate() will return with the error code + Z_DATA_ERROR instead of trying to allocate a larger window. + + windowBits can also be zero to request that inflate use the window size in + the zlib header of the compressed stream. + + windowBits can also be -8..-15 for raw inflate. In this case, -windowBits + determines the window size. inflate() will then process raw deflate data, + not looking for a zlib or gzip header, not generating a check value, and not + looking for any check values for comparison at the end of the stream. This + is for use with other formats that use the deflate compressed data format + such as zip. Those formats provide their own check values. If a custom + format is developed using the raw deflate format for compressed data, it is + recommended that a check value such as an Adler-32 or a CRC-32 be applied to + the uncompressed data as is done in the zlib, gzip, and zip formats. For + most applications, the zlib format should be used as is. Note that comments + above on the use in deflateInit2() applies to the magnitude of windowBits. + + windowBits can also be greater than 15 for optional gzip decoding. Add + 32 to windowBits to enable zlib and gzip decoding with automatic header + detection, or add 16 to decode only the gzip format (the zlib format will + return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a + CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see + below), inflate() will *not* automatically decode concatenated gzip members. + inflate() will return Z_STREAM_END at the end of the gzip member. The state + would need to be reset to continue decoding a subsequent gzip member. This + *must* be done if there is more data after a gzip member, in order for the + decompression to be compliant with the gzip standard (RFC 1952). + + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the + version assumed by the caller, or Z_STREAM_ERROR if the parameters are + invalid, such as a null pointer to the structure. msg is set to null if + there is no error message. inflateInit2 does not perform any decompression + apart from possibly reading the zlib header if present: actual decompression + will be done by inflate(). (So next_in and avail_in may be modified, but + next_out and avail_out are unused and unchanged.) The current implementation + of inflateInit2() does not process any header information -- that is + deferred until inflate() is called. +*/ + +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, + const Bytef *dictionary, + uInt dictLength)); +/* + Initializes the decompression dictionary from the given uncompressed byte + sequence. This function must be called immediately after a call of inflate, + if that call returned Z_NEED_DICT. The dictionary chosen by the compressor + can be determined from the Adler-32 value returned by that call of inflate. + The compressor and decompressor must use exactly the same dictionary (see + deflateSetDictionary). For raw inflate, this function can be called at any + time to set the dictionary. If the provided dictionary is smaller than the + window and there is already data in the window, then the provided dictionary + will amend what's there. The application must insure that the dictionary + that was used for compression is provided. + + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a + parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the + expected one (incorrect Adler-32 value). inflateSetDictionary does not + perform any decompression: this will be done by subsequent calls of + inflate(). +*/ + +ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by inflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If inflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similarly, if dictLength is Z_NULL, then it is not set. + + inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +/* + Skips invalid compressed data until a possible full flush point (see above + for the description of deflate with Z_FULL_FLUSH) can be found, or until all + available input is skipped. No output is provided. + + inflateSync searches for a 00 00 FF FF pattern in the compressed data. + All full flush points have this pattern, but not all occurrences of this + pattern are full flush points. + + inflateSync returns Z_OK if a possible full flush point has been found, + Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point + has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. + In the success case, the application may save the current current value of + total_in which indicates where valid compressed data was found. In the + error case, the application may repeatedly call inflateSync, providing more + input each time, until success or end of the input data. +*/ + +ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, + z_streamp source)); +/* + Sets the destination stream as a complete copy of the source stream. + + This function can be useful when randomly accessing a large stream. The + first pass through the stream can periodically record the inflate state, + allowing restarting inflate at those points when randomly accessing the + stream. + + inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent + (such as zalloc being Z_NULL). msg is left unchanged in both source and + destination. +*/ + +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +/* + This function is equivalent to inflateEnd followed by inflateInit, + but does not free and reallocate the internal decompression state. The + stream will keep attributes that may have been set by inflateInit2. + + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL). +*/ + +ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, + int windowBits)); +/* + This function is the same as inflateReset, but it also permits changing + the wrap and window size requests. The windowBits parameter is interpreted + the same as it is for inflateInit2. If the window size is changed, then the + memory allocated for the window is freed, and the window will be reallocated + by inflate() if needed. + + inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent (such as zalloc or state being Z_NULL), or if + the windowBits parameter is invalid. +*/ + +ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); +/* + This function inserts bits in the inflate input stream. The intent is + that this function is used to start inflating at a bit position in the + middle of a byte. The provided bits will be used before any bytes are used + from next_in. This function should only be used with raw inflate, and + should be used before the first inflate() call after inflateInit2() or + inflateReset(). bits must be less than or equal to 16, and that many of the + least significant bits of value will be inserted in the input. + + If bits is negative, then the input stream bit buffer is emptied. Then + inflatePrime() can be called again to put bits in the buffer. This is used + to clear out bits leftover after feeding inflate a block description prior + to feeding inflate codes. + + inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); +/* + This function returns two values, one in the lower 16 bits of the return + value, and the other in the remaining upper bits, obtained by shifting the + return value down 16 bits. If the upper value is -1 and the lower value is + zero, then inflate() is currently decoding information outside of a block. + If the upper value is -1 and the lower value is non-zero, then inflate is in + the middle of a stored block, with the lower value equaling the number of + bytes from the input remaining to copy. If the upper value is not -1, then + it is the number of bits back from the current bit position in the input of + the code (literal or length/distance pair) currently being processed. In + that case the lower value is the number of bytes already emitted for that + code. + + A code is being processed if inflate is waiting for more input to complete + decoding of the code, or if it has completed decoding but is waiting for + more output space to write the literal or match data. + + inflateMark() is used to mark locations in the input data for random + access, which may be at bit positions, and to note those cases where the + output of a code may span boundaries of random access blocks. The current + location in the input stream can be determined from avail_in and data_type + as noted in the description for the Z_BLOCK flush parameter for inflate. + + inflateMark returns the value noted above, or -65536 if the provided + source stream state was inconsistent. +*/ + +ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, + gz_headerp head)); +/* + inflateGetHeader() requests that gzip header information be stored in the + provided gz_header structure. inflateGetHeader() may be called after + inflateInit2() or inflateReset(), and before the first call of inflate(). + As inflate() processes the gzip stream, head->done is zero until the header + is completed, at which time head->done is set to one. If a zlib stream is + being decoded, then head->done is set to -1 to indicate that there will be + no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be + used to force inflate() to return immediately after header processing is + complete and before any actual data is decompressed. + + The text, time, xflags, and os fields are filled in with the gzip header + contents. hcrc is set to true if there is a header CRC. (The header CRC + was valid if done is set to one.) If extra is not Z_NULL, then extra_max + contains the maximum number of bytes to write to extra. Once done is true, + extra_len contains the actual extra field length, and extra contains the + extra field, or that field truncated if extra_max is less than extra_len. + If name is not Z_NULL, then up to name_max characters are written there, + terminated with a zero unless the length is greater than name_max. If + comment is not Z_NULL, then up to comm_max characters are written there, + terminated with a zero unless the length is greater than comm_max. When any + of extra, name, or comment are not Z_NULL and the respective field is not + present in the header, then that field is set to Z_NULL to signal its + absence. This allows the use of deflateSetHeader() with the returned + structure to duplicate the header. However if those fields are set to + allocated memory, then the application will need to save those pointers + elsewhere so that they can be eventually freed. + + If inflateGetHeader is not used, then the header information is simply + discarded. The header is always checked for validity, including the header + CRC if present. inflateReset() will reset the process to discard the header + information. The application would need to call inflateGetHeader() again to + retrieve the header from the next gzip stream. + + inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. +*/ + +/* +ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, + unsigned char FAR *window)); + + Initialize the internal stream state for decompression using inflateBack() + calls. The fields zalloc, zfree and opaque in strm must be initialized + before the call. If zalloc and zfree are Z_NULL, then the default library- + derived memory allocation routines are used. windowBits is the base two + logarithm of the window size, in the range 8..15. window is a caller + supplied buffer of that size. Except for special applications where it is + assured that deflate was used with small window sizes, windowBits must be 15 + and a 32K byte window must be supplied to be able to decompress general + deflate streams. + + See inflateBack() for the usage of these routines. + + inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of + the parameters are invalid, Z_MEM_ERROR if the internal state could not be + allocated, or Z_VERSION_ERROR if the version of the library does not match + the version of the header file. +*/ + +typedef unsigned (*in_func) OF((void FAR *, + z_const unsigned char FAR * FAR *)); +typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); + +ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, + in_func in, void FAR *in_desc, + out_func out, void FAR *out_desc)); +/* + inflateBack() does a raw inflate with a single call using a call-back + interface for input and output. This is potentially more efficient than + inflate() for file i/o applications, in that it avoids copying between the + output and the sliding window by simply making the window itself the output + buffer. inflate() can be faster on modern CPUs when used with large + buffers. inflateBack() trusts the application to not change the output + buffer passed by the output function, at least until inflateBack() returns. + + inflateBackInit() must be called first to allocate the internal state + and to initialize the state with the user-provided window buffer. + inflateBack() may then be used multiple times to inflate a complete, raw + deflate stream with each call. inflateBackEnd() is then called to free the + allocated state. + + A raw deflate stream is one with no zlib or gzip header or trailer. + This routine would normally be used in a utility that reads zip or gzip + files and writes out uncompressed files. The utility would decode the + header and process the trailer on its own, hence this routine expects only + the raw deflate stream to decompress. This is different from the default + behavior of inflate(), which expects a zlib header and trailer around the + deflate stream. + + inflateBack() uses two subroutines supplied by the caller that are then + called by inflateBack() for input and output. inflateBack() calls those + routines until it reads a complete deflate stream and writes out all of the + uncompressed data, or until it encounters an error. The function's + parameters and return types are defined above in the in_func and out_func + typedefs. inflateBack() will call in(in_desc, &buf) which should return the + number of bytes of provided input, and a pointer to that input in buf. If + there is no input available, in() must return zero -- buf is ignored in that + case -- and inflateBack() will return a buffer error. inflateBack() will + call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. + out() should return zero on success, or non-zero on failure. If out() + returns non-zero, inflateBack() will return with an error. Neither in() nor + out() are permitted to change the contents of the window provided to + inflateBackInit(), which is also the buffer that out() uses to write from. + The length written by out() will be at most the window size. Any non-zero + amount of input may be provided by in(). + + For convenience, inflateBack() can be provided input on the first call by + setting strm->next_in and strm->avail_in. If that input is exhausted, then + in() will be called. Therefore strm->next_in must be initialized before + calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called + immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in + must also be initialized, and then if strm->avail_in is not zero, input will + initially be taken from strm->next_in[0 .. strm->avail_in - 1]. + + The in_desc and out_desc parameters of inflateBack() is passed as the + first parameter of in() and out() respectively when they are called. These + descriptors can be optionally used to pass any information that the caller- + supplied in() and out() functions need to do their job. + + On return, inflateBack() will set strm->next_in and strm->avail_in to + pass back any unused input that was provided by the last in() call. The + return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR + if in() or out() returned an error, Z_DATA_ERROR if there was a format error + in the deflate stream (in which case strm->msg is set to indicate the nature + of the error), or Z_STREAM_ERROR if the stream was not properly initialized. + In the case of Z_BUF_ERROR, an input or output error can be distinguished + using strm->next_in which will be Z_NULL only if in() returned an error. If + strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning + non-zero. (in() will always be called before out(), so strm->next_in is + assured to be defined if out() returns non-zero.) Note that inflateBack() + cannot return Z_OK. +*/ + +ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); +/* + All memory allocated by inflateBackInit() is freed. + + inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream + state was inconsistent. +*/ + +ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); +/* Return flags indicating compile-time options. + + Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: + 1.0: size of uInt + 3.2: size of uLong + 5.4: size of voidpf (pointer) + 7.6: size of z_off_t + + Compiler, assembler, and debug options: + 8: ZLIB_DEBUG + 9: ASMV or ASMINF -- use ASM code + 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention + 11: 0 (reserved) + + One-time table building (smaller code, but not thread-safe if true): + 12: BUILDFIXED -- build static block decoding tables when needed + 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed + 14,15: 0 (reserved) + + Library content (indicates missing functionality): + 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking + deflate code when not needed) + 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect + and decode gzip streams (to avoid linking crc code) + 18-19: 0 (reserved) + + Operation variations (changes in library functionality): + 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate + 21: FASTEST -- deflate algorithm with only one, lowest compression level + 22,23: 0 (reserved) + + The sprintf variant used by gzprintf (zero is best): + 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format + 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! + 26: 0 = returns value, 1 = void -- 1 means inferred string length returned + + Remainder: + 27-31: 0 (reserved) + */ + +#ifndef Z_SOLO + + /* utility functions */ + +/* + The following utility functions are implemented on top of the basic + stream-oriented functions. To simplify the interface, some default options + are assumed (compression level and memory usage, standard memory allocation + functions). The source code of these utility functions can be modified if + you need special options. +*/ + +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Compresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed data. compress() is equivalent to compress2() with a level + parameter of Z_DEFAULT_COMPRESSION. + + compress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer. +*/ + +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen, + int level)); +/* + Compresses the source buffer into the destination buffer. The level + parameter has the same meaning as in deflateInit. sourceLen is the byte + length of the source buffer. Upon entry, destLen is the total size of the + destination buffer, which must be at least the value returned by + compressBound(sourceLen). Upon exit, destLen is the actual size of the + compressed data. + + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, + Z_STREAM_ERROR if the level parameter is invalid. +*/ + +ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); +/* + compressBound() returns an upper bound on the compressed size after + compress() or compress2() on sourceLen bytes. It would be used before a + compress() or compress2() call to allocate the destination buffer. +*/ + +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong sourceLen)); +/* + Decompresses the source buffer into the destination buffer. sourceLen is + the byte length of the source buffer. Upon entry, destLen is the total size + of the destination buffer, which must be large enough to hold the entire + uncompressed data. (The size of the uncompressed data must have been saved + previously by the compressor and transmitted to the decompressor by some + mechanism outside the scope of this compression library.) Upon exit, destLen + is the actual size of the uncompressed data. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not + enough memory, Z_BUF_ERROR if there was not enough room in the output + buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In + the case where there is not enough room, uncompress() will fill the output + buffer with the uncompressed data up to that point. +*/ + +ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen)); +/* + Same as uncompress, except that sourceLen is a pointer, where the + length of the source is *sourceLen. On return, *sourceLen is the number of + source bytes consumed. +*/ + + /* gzip file access functions */ + +/* + This library supports reading and writing files in gzip (.gz) format with + an interface similar to that of stdio, using the functions that start with + "gz". The gzip format is different from the zlib format. gzip is a gzip + wrapper, documented in RFC 1952, wrapped around a deflate stream. +*/ + +typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */ + +/* +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); + + Open the gzip (.gz) file at path for reading and decompressing, or + compressing and writing. The mode parameter is as in fopen ("rb" or "wb") + but can also include a compression level ("wb9") or a strategy: 'f' for + filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", + 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression + as in "wb9F". (See the description of deflateInit2 for more information + about the strategy parameter.) 'T' will request transparent writing or + appending with no compression and not using the gzip format. + + "a" can be used instead of "w" to request that the gzip stream that will + be written be appended to the file. "+" will result in an error, since + reading and writing to the same gzip file is not supported. The addition of + "x" when writing will create the file exclusively, which fails if the file + already exists. On systems that support it, the addition of "e" when + reading or writing will set the flag to close the file on an execve() call. + + These functions, as well as gzip, will read and decode a sequence of gzip + streams in a file. The append function of gzopen() can be used to create + such a file. (Also see gzflush() for another way to do this.) When + appending, gzopen does not test whether the file begins with a gzip stream, + nor does it look for the end of the gzip streams to begin appending. gzopen + will simply append a gzip stream to the existing file. + + gzopen can be used to read a file which is not in gzip format; in this + case gzread will directly read from the file without decompression. When + reading, this will be detected automatically by looking for the magic two- + byte gzip header. + + gzopen returns NULL if the file could not be opened, if there was + insufficient memory to allocate the gzFile state, or if an invalid mode was + specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). + errno can be checked to determine if the reason gzopen failed was that the + file could not be opened. +*/ + +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); +/* + Associate a gzFile with the file descriptor fd. File descriptors are + obtained from calls like open, dup, creat, pipe or fileno (if the file has + been previously opened with fopen). The mode parameter is as in gzopen. + + The next call of gzclose on the returned gzFile will also close the file + descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor + fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, + mode);. The duplicated descriptor should be saved to avoid a leak, since + gzdopen does not close fd if it fails. If you are using fileno() to get the + file descriptor from a FILE *, then you will have to use dup() to avoid + double-close()ing the file descriptor. Both gzclose() and fclose() will + close the associated file descriptor, so they need to have different file + descriptors. + + gzdopen returns NULL if there was insufficient memory to allocate the + gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not + provided, or '+' was provided), or if fd is -1. The file descriptor is not + used until the next gz* read, write, seek, or close operation, so gzdopen + will not detect if fd is invalid (unless fd is -1). +*/ + +ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); +/* + Set the internal buffer size used by this library's functions for file to + size. The default buffer size is 8192 bytes. This function must be called + after gzopen() or gzdopen(), and before any other calls that read or write + the file. The buffer memory allocation is always deferred to the first read + or write. Three times that size in buffer space is allocated. A larger + buffer size of, for example, 64K or 128K bytes will noticeably increase the + speed of decompression (reading). + + The new buffer size also affects the maximum length for gzprintf(). + + gzbuffer() returns 0 on success, or -1 on failure, such as being called + too late. +*/ + +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); +/* + Dynamically update the compression level and strategy for file. See the + description of deflateInit2 for the meaning of these parameters. Previously + provided data is flushed before applying the parameter changes. + + gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not + opened for writing, Z_ERRNO if there is an error writing the flushed data, + or Z_MEM_ERROR if there is a memory allocation error. +*/ + +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); +/* + Read and decompress up to len uncompressed bytes from file into buf. If + the input file is not in gzip format, gzread copies the given number of + bytes into the buffer directly from the file. + + After reaching the end of a gzip stream in the input, gzread will continue + to read, looking for another gzip stream. Any number of gzip streams may be + concatenated in the input file, and will all be decompressed by gzread(). + If something other than a gzip stream is encountered after a gzip stream, + that remaining trailing garbage is ignored (and no error is returned). + + gzread can be used to read a gzip file that is being concurrently written. + Upon reaching the end of the input, gzread will return with the available + data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then + gzclearerr can be used to clear the end of file indicator in order to permit + gzread to be tried again. Z_OK indicates that a gzip stream was completed + on the last gzread. Z_BUF_ERROR indicates that the input file ended in the + middle of a gzip stream. Note that gzread does not return -1 in the event + of an incomplete gzip stream. This error is deferred until gzclose(), which + will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip + stream. Alternatively, gzerror can be used before gzclose to detect this + case. + + gzread returns the number of uncompressed bytes actually read, less than + len for end of file, or -1 for error. If len is too large to fit in an int, + then nothing is read, -1 is returned, and the error state is set to + Z_STREAM_ERROR. +*/ + +ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, + gzFile file)); +/* + Read and decompress up to nitems items of size size from file into buf, + otherwise operating as gzread() does. This duplicates the interface of + stdio's fread(), with size_t request and return types. If the library + defines size_t, then z_size_t is identical to size_t. If not, then z_size_t + is an unsigned integer type that can contain a pointer. + + gzfread() returns the number of full items read of size size, or zero if + the end of the file was reached and a full item could not be read, or if + there was an error. gzerror() must be consulted if zero is returned in + order to determine if there was an error. If the multiplication of size and + nitems overflows, i.e. the product does not fit in a z_size_t, then nothing + is read, zero is returned, and the error state is set to Z_STREAM_ERROR. + + In the event that the end of file is reached and only a partial item is + available at the end, i.e. the remaining uncompressed data length is not a + multiple of size, then the final partial item is nevertheless read into buf + and the end-of-file flag is set. The length of the partial item read is not + provided, but could be inferred from the result of gztell(). This behavior + is the same as the behavior of fread() implementations in common libraries, + but it prevents the direct use of gzfread() to read a concurrently written + file, resetting and retrying on end-of-file, when size is not 1. +*/ + +ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); +/* + Compress and write the len uncompressed bytes at buf to file. gzwrite + returns the number of uncompressed bytes written or 0 in case of error. +*/ + +ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, + z_size_t nitems, gzFile file)); +/* + Compress and write nitems items of size size from buf to file, duplicating + the interface of stdio's fwrite(), with size_t request and return types. If + the library defines size_t, then z_size_t is identical to size_t. If not, + then z_size_t is an unsigned integer type that can contain a pointer. + + gzfwrite() returns the number of full items written of size size, or zero + if there was an error. If the multiplication of size and nitems overflows, + i.e. the product does not fit in a z_size_t, then nothing is written, zero + is returned, and the error state is set to Z_STREAM_ERROR. +*/ + +ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); +/* + Convert, format, compress, and write the arguments (...) to file under + control of the string format, as in fprintf. gzprintf returns the number of + uncompressed bytes actually written, or a negative zlib error code in case + of error. The number of uncompressed bytes written is limited to 8191, or + one less than the buffer size given to gzbuffer(). The caller should assure + that this limit is not exceeded. If it is exceeded, then gzprintf() will + return an error (0) with nothing written. In this case, there may also be a + buffer overflow with unpredictable consequences, which is possible only if + zlib was compiled with the insecure functions sprintf() or vsprintf(), + because the secure snprintf() or vsnprintf() functions were not available. + This can be determined using zlibCompileFlags(). +*/ + +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); +/* + Compress and write the given null-terminated string s to file, excluding + the terminating null character. + + gzputs returns the number of characters written, or -1 in case of error. +*/ + +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); +/* + Read and decompress bytes from file into buf, until len-1 characters are + read, or until a newline character is read and transferred to buf, or an + end-of-file condition is encountered. If any characters are read or if len + is one, the string is terminated with a null character. If no characters + are read due to an end-of-file or len is less than one, then the buffer is + left untouched. + + gzgets returns buf which is a null-terminated string, or it returns NULL + for end-of-file or in case of error. If there was an error, the contents at + buf are indeterminate. +*/ + +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); +/* + Compress and write c, converted to an unsigned char, into file. gzputc + returns the value that was written, or -1 in case of error. +*/ + +ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); +/* + Read and decompress one byte from file. gzgetc returns this byte or -1 + in case of end of file or error. This is implemented as a macro for speed. + As such, it does not do all of the checking the other functions do. I.e. + it does not check to see if file is NULL, nor whether the structure file + points to has been clobbered or not. +*/ + +ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); +/* + Push c back onto the stream for file to be read as the first character on + the next read. At least one character of push-back is always allowed. + gzungetc() returns the character pushed, or -1 on failure. gzungetc() will + fail if c is -1, and may fail if a character has been pushed but not read + yet. If gzungetc is used immediately after gzopen or gzdopen, at least the + output buffer size of pushed characters is allowed. (See gzbuffer above.) + The pushed character will be discarded if the stream is repositioned with + gzseek() or gzrewind(). +*/ + +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); +/* + Flush all pending output to file. The parameter flush is as in the + deflate() function. The return value is the zlib error number (see function + gzerror below). gzflush is only permitted when writing. + + If the flush parameter is Z_FINISH, the remaining data is written and the + gzip stream is completed in the output. If gzwrite() is called again, a new + gzip stream will be started in the output. gzread() is able to read such + concatenated gzip streams. + + gzflush should be called only when strictly necessary because it will + degrade compression if called too often. +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, + z_off_t offset, int whence)); + + Set the starting position to offset relative to whence for the next gzread + or gzwrite on file. The offset represents a number of bytes in the + uncompressed data stream. The whence parameter is defined as in lseek(2); + the value SEEK_END is not supported. + + If the file is opened for reading, this function is emulated but can be + extremely slow. If the file is opened for writing, only forward seeks are + supported; gzseek then compresses a sequence of zeroes up to the new + starting position. + + gzseek returns the resulting offset location as measured in bytes from + the beginning of the uncompressed stream, or -1 in case of error, in + particular if the file is opened for writing and the new starting position + would be before the current position. +*/ + +ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); +/* + Rewind file. This function is supported only for reading. + + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET). +*/ + +/* +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); + + Return the starting position for the next gzread or gzwrite on file. + This position represents a number of bytes in the uncompressed data stream, + and is zero when starting, even if appending or reading a gzip stream from + the middle of a file using gzdopen(). + + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) +*/ + +/* +ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); + + Return the current compressed (actual) read or write offset of file. This + offset includes the count of bytes that precede the gzip stream, for example + when appending or when using gzdopen() for reading. When reading, the + offset does not include as yet unused buffered input. This information can + be used for a progress indicator. On error, gzoffset() returns -1. +*/ + +ZEXTERN int ZEXPORT gzeof OF((gzFile file)); +/* + Return true (1) if the end-of-file indicator for file has been set while + reading, false (0) otherwise. Note that the end-of-file indicator is set + only if the read tried to go past the end of the input, but came up short. + Therefore, just like feof(), gzeof() may return false even if there is no + more data to read, in the event that the last read request was for the exact + number of bytes remaining in the input file. This will happen if the input + file size is an exact multiple of the buffer size. + + If gzeof() returns true, then the read functions will return no more data, + unless the end-of-file indicator is reset by gzclearerr() and the input file + has grown since the previous end of file was detected. +*/ + +ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); +/* + Return true (1) if file is being copied directly while reading, or false + (0) if file is a gzip stream being decompressed. + + If the input file is empty, gzdirect() will return true, since the input + does not contain a gzip stream. + + If gzdirect() is used immediately after gzopen() or gzdopen() it will + cause buffers to be allocated to allow reading the file to determine if it + is a gzip file. Therefore if gzbuffer() is used, it should be called before + gzdirect(). + + When writing, gzdirect() returns true (1) if transparent writing was + requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note: + gzdirect() is not needed when writing. Transparent writing must be + explicitly requested, so the application already knows the answer. When + linking statically, using gzdirect() will include all of the zlib code for + gzip file reading and decompression, which may not be desired.) +*/ + +ZEXTERN int ZEXPORT gzclose OF((gzFile file)); +/* + Flush all pending output for file, if necessary, close file and + deallocate the (de)compression state. Note that once file is closed, you + cannot call gzerror with file, since its structures have been deallocated. + gzclose must not be called more than once on the same file, just as free + must not be called more than once on the same allocation. + + gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a + file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the + last read ended in the middle of a gzip stream, or Z_OK on success. +*/ + +ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); +ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); +/* + Same as gzclose(), but gzclose_r() is only for use when reading, and + gzclose_w() is only for use when writing or appending. The advantage to + using these instead of gzclose() is that they avoid linking in zlib + compression or decompression code that is not used when only reading or only + writing respectively. If gzclose() is used, then both compression and + decompression code will be included the application when linking to a static + zlib library. +*/ + +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); +/* + Return the error message for the last error which occurred on file. + errnum is set to zlib error number. If an error occurred in the file system + and not in the compression library, errnum is set to Z_ERRNO and the + application may consult errno to get the exact error code. + + The application must not modify the returned string. Future calls to + this function may invalidate the previously returned string. If file is + closed, then the string previously returned by gzerror will no longer be + available. + + gzerror() should be used to distinguish errors from end-of-file for those + functions above that do not distinguish those cases in their return values. +*/ + +ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); +/* + Clear the error and end-of-file flags for file. This is analogous to the + clearerr() function in stdio. This is useful for continuing to read a gzip + file that is being written concurrently. +*/ + +#endif /* !Z_SOLO */ + + /* checksum functions */ + +/* + These functions are not related to compression but are exported + anyway because they might be useful in applications using the compression + library. +*/ + +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +/* + Update a running Adler-32 checksum with the bytes buf[0..len-1] and + return the updated checksum. An Adler-32 value is in the range of a 32-bit + unsigned integer. If buf is Z_NULL, this function returns the required + initial value for the checksum. + + An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed + much faster. + + Usage example: + + uLong adler = adler32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + adler = adler32(adler, buffer, length); + } + if (adler != original_adler) error(); +*/ + +ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, + z_size_t len)); +/* + Same as adler32(), but with a size_t length. +*/ + +/* +ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); + + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note + that the z_off_t type (like off_t) is a signed integer. If len2 is + negative, the result has no meaning or utility. +*/ + +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); +/* + Update a running CRC-32 with the bytes buf[0..len-1] and return the + updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer. + If buf is Z_NULL, this function returns the required initial value for the + crc. Pre- and post-conditioning (one's complement) is performed within this + function so it shouldn't be done by the application. + + Usage example: + + uLong crc = crc32(0L, Z_NULL, 0); + + while (read_buffer(buffer, length) != EOF) { + crc = crc32(crc, buffer, length); + } + if (crc != original_crc) error(); +*/ + +ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf, + z_size_t len)); +/* + Same as crc32(), but with a size_t length. +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. +*/ + +/* +ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2)); + + Return the operator corresponding to length len2, to be used with + crc32_combine_op(). +*/ + +ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op)); +/* + Give the same result as crc32_combine(), using op in place of len2. op is + is generated from len2 by crc32_combine_gen(). This will be faster than + crc32_combine() if the generated op is used more than once. +*/ + + + /* various hacks, don't look :) */ + +/* deflateInit and inflateInit are macros to allow checking the zlib version + * and the compiler's view of z_stream: + */ +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, + int windowBits, int memLevel, + int strategy, const char *version, + int stream_size)); +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, + const char *version, int stream_size)); +ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, + unsigned char FAR *window, + const char *version, + int stream_size)); +#ifdef Z_PREFIX_SET +# define z_deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define z_inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#else +# define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#endif + +#ifndef Z_SOLO + +/* gzgetc() macro and its supporting function and exposed data structure. Note + * that the real internal state is much larger than the exposed structure. + * This abbreviated structure exposes just enough for the gzgetc() macro. The + * user should not mess with these exposed elements, since their names or + * behavior could change in the future, perhaps even capriciously. They can + * only be used by the gzgetc() macro. You have been warned. + */ +struct gzFile_s { + unsigned have; + unsigned char *next; + z_off64_t pos; +}; +ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ +#ifdef Z_PREFIX_SET +# undef z_gzgetc +# define z_gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#else +# define gzgetc(g) \ + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) +#endif + +/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or + * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if + * both are true, the application gets the *64 functions, and the regular + * functions are changed to 64 bits) -- in case these are set on systems + * without large file support, _LFS64_LARGEFILE must also be true + */ +#ifdef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t)); +#endif + +#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64) +# ifdef Z_PREFIX_SET +# define z_gzopen z_gzopen64 +# define z_gzseek z_gzseek64 +# define z_gztell z_gztell64 +# define z_gzoffset z_gzoffset64 +# define z_adler32_combine z_adler32_combine64 +# define z_crc32_combine z_crc32_combine64 +# define z_crc32_combine_gen z_crc32_combine_gen64 +# else +# define gzopen gzopen64 +# define gzseek gzseek64 +# define gztell gztell64 +# define gzoffset gzoffset64 +# define adler32_combine adler32_combine64 +# define crc32_combine crc32_combine64 +# define crc32_combine_gen crc32_combine_gen64 +# endif +# ifndef Z_LARGE64 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t)); +# endif +#else + ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); + ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); +#endif + +#else /* Z_SOLO */ + + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); + ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t)); + +#endif /* !Z_SOLO */ + +/* undocumented functions */ +ZEXTERN const char * ZEXPORT zError OF((int)); +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); +ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); +ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); +ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF((z_streamp)); +ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); +ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); +#if defined(_WIN32) && !defined(Z_SOLO) +ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, + const char *mode)); +#endif +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +# ifndef Z_SOLO +ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file, + const char *format, + va_list va)); +# endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ZLIB_H */ diff --git a/include/libzip/l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5hBb&&w__pW)JhUpCb3Bps+D1lNE2Tqu@f&3;z<$k()Hs~Agt I18cVCe|!TI*Z=?k literal 0 HcmV?d00001 From d0d2df7f425f69a44e97aa9c5e12bff07b6c8ecc Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Sun, 4 Dec 2022 01:20:55 +0100 Subject: [PATCH 14/78] feat: read mods files from zip archive --- NorthstarDLL/verifiedmods.cpp | 51 +++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 2482299d8..bd193bf9d 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -5,6 +5,7 @@ #include "rapidjson/stringbuffer.h" #include "squirrel.h" #include "verifiedmods.h" +#include "libzip/include/zip.h" using namespace rapidjson; @@ -148,14 +149,15 @@ void DownloadMod(char* modName, char* modVersion) std::thread requestThread( [dependencyString, modName]() { + std::string archiveName = (std::string)dependencyString + ".zip"; // loading game path - std::filesystem::path downloadPath = std::filesystem::temp_directory_path() / ((std::string)dependencyString + ".zip"); + std::filesystem::path downloadPath = std::filesystem::temp_directory_path() / archiveName; CURL* curl = curl_easy_init(); FILE* fp = fopen(downloadPath.generic_string().c_str(), "wb"); CURLcode result; - std::string url = "https://gcdn.thunderstore.io/live/repository/packages/" + (std::string)dependencyString + ".zip"; + std::string url = "https://gcdn.thunderstore.io/live/repository/packages/" + archiveName; spdlog::info("Downloading mod:"); spdlog::info(" => from {}", url); spdlog::info(" => to {}", downloadPath.generic_string()); @@ -170,7 +172,8 @@ void DownloadMod(char* modName, char* modVersion) if (result == CURLcode::CURLE_OK) { - spdlog::info("Ok"); + spdlog::info("Mod successfully fetched."); + fclose(fp); } else { @@ -178,8 +181,46 @@ void DownloadMod(char* modName, char* modVersion) return; } - // TODO unzip folder - // TODO move mod to mods/ folder + // Unzip mods from downloaded archive. + int err = 0; + zip_t* zip = zip_open(downloadPath.generic_string().c_str(), ZIP_RDONLY, &err); + + if (err != ZIP_ER_OK) + { + spdlog::error("Opening mod archive failed: {}", zip_strerror(zip)); + return; + } + + zip_file* p_file = zip_fopen(zip, "mods/", 0); + if (p_file == NULL) + { + spdlog::error("Reading mod archive failed: {}", zip_strerror(zip)); + return; + } + + spdlog::info("Starting extracting files from archive."); + zip_int64_t num_entries = zip_get_num_entries(zip, 0); + for (zip_uint64_t i = 0; i < num_entries; ++i) + { + const char* name = zip_get_name(zip, i, 0); + if (name == nullptr) + { + spdlog::error("Failed reading archive."); + return; + } + + // Only extracting files that belong to mods. + std::string modName = name; + if (strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") + { + continue; + } + + spdlog::info(" => {}", name); + + // TODO create directories and files into game folder + } + // TODO remove temporary folder REQUEST_END_CLEANUP: From 448e706b04b470d280e6b59611dc6aea89b1b60b Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Sun, 4 Dec 2022 01:51:51 +0100 Subject: [PATCH 15/78] refactor: remove mod status check from DownloadMod method Squirrel VM invokes the DownloadMod method only after ensuring mod is verified (by calling IsModVerified), so there's no need to invoke IsModVerified a second time. --- NorthstarDLL/verifiedmods.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index bd193bf9d..ec6407288 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -131,12 +131,12 @@ size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) * * Fetching mod .zip archive from Thunderstore API to local temporary storage; * * Extracting archive content into game folder; * * Cleaning. + * + * Before calling this, you MUST ensure mod is verified by invoking the + * IsModVerified method. **/ void DownloadMod(char* modName, char* modVersion) { - if (!IsModVerified(modName, modVersion)) - return; - modsBeingDownloaded.push_back( modName ); // Rebuild mod dependency string. From 0aa88b4bd1817175b18653b75338255cc37ac36b Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Sun, 4 Dec 2022 22:36:20 +0100 Subject: [PATCH 16/78] feat: extract folders from archive --- NorthstarDLL/verifiedmods.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index ec6407288..5b8687c2e 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -210,8 +210,9 @@ void DownloadMod(char* modName, char* modVersion) } // Only extracting files that belong to mods. + // TODO uncomment line below when extracting to game folder std::string modName = name; - if (strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") + if (/* strcmp(name, "mods/") == 0 ||*/ modName.substr(0, 5) != "mods/") { continue; } @@ -219,6 +220,10 @@ void DownloadMod(char* modName, char* modVersion) spdlog::info(" => {}", name); // TODO create directories and files into game folder + if (modName.back() == '/') + { + std::filesystem::create_directory(std::filesystem::temp_directory_path() / name); + } } // TODO remove temporary folder From 3565741789f972428efcef04be1789ba6a43ca93 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Sun, 4 Dec 2022 23:06:18 +0100 Subject: [PATCH 17/78] feat: extract files from archive --- NorthstarDLL/verifiedmods.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 5b8687c2e..10d468684 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -6,6 +6,7 @@ #include "squirrel.h" #include "verifiedmods.h" #include "libzip/include/zip.h" +#include using namespace rapidjson; @@ -224,6 +225,25 @@ void DownloadMod(char* modName, char* modVersion) { std::filesystem::create_directory(std::filesystem::temp_directory_path() / name); } + else + { + struct zip_stat sb; + zip_stat_index(zip, i, 0, &sb); + struct zip_file* zf = zip_fopen_index(zip, i, 0); + std::ofstream writeStream(std::filesystem::temp_directory_path() / name, std::ofstream::binary); + + int sum = 0; + int len = 0; + char buf[100]; + + while (sum != sb.size) + { + len = zip_fread(zf, buf, 100); + writeStream.write((char*)buf, len); + sum += len; + } + writeStream.close(); + } } // TODO remove temporary folder From 16af7598ce1b2ce84f27c211a9435c72eda62152 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Sun, 4 Dec 2022 23:50:08 +0100 Subject: [PATCH 18/78] feat: extract archive content directly into mods/ folder --- NorthstarDLL/verifiedmods.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 10d468684..15f31e8b0 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -7,6 +7,7 @@ #include "verifiedmods.h" #include "libzip/include/zip.h" #include +#include "nsprefix.h" using namespace rapidjson; @@ -200,6 +201,9 @@ void DownloadMod(char* modName, char* modVersion) } spdlog::info("Starting extracting files from archive."); + + InitialiseNorthstarPrefix(); + zip_int64_t num_entries = zip_get_num_entries(zip, 0); for (zip_uint64_t i = 0; i < num_entries; ++i) { @@ -211,26 +215,25 @@ void DownloadMod(char* modName, char* modVersion) } // Only extracting files that belong to mods. - // TODO uncomment line below when extracting to game folder std::string modName = name; - if (/* strcmp(name, "mods/") == 0 ||*/ modName.substr(0, 5) != "mods/") + if (strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") { continue; } spdlog::info(" => {}", name); + std::filesystem::path destination = std::filesystem::path(GetNorthstarPrefix()) / name; - // TODO create directories and files into game folder if (modName.back() == '/') { - std::filesystem::create_directory(std::filesystem::temp_directory_path() / name); + std::filesystem::create_directory(destination); } else { struct zip_stat sb; zip_stat_index(zip, i, 0, &sb); struct zip_file* zf = zip_fopen_index(zip, i, 0); - std::ofstream writeStream(std::filesystem::temp_directory_path() / name, std::ofstream::binary); + std::ofstream writeStream(destination, std::ofstream::binary); int sum = 0; int len = 0; From ae6dfc0a0b31bb964871d9244924b844e92c60a6 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Wed, 7 Dec 2022 00:03:02 +0100 Subject: [PATCH 19/78] refactor: remove unused code --- NorthstarDLL/verifiedmods.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 15f31e8b0..665c4d5dd 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -193,13 +193,6 @@ void DownloadMod(char* modName, char* modVersion) return; } - zip_file* p_file = zip_fopen(zip, "mods/", 0); - if (p_file == NULL) - { - spdlog::error("Reading mod archive failed: {}", zip_strerror(zip)); - return; - } - spdlog::info("Starting extracting files from archive."); InitialiseNorthstarPrefix(); From 1e6b9917767c20b88ebca3eb772a885ff5e62483 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Wed, 7 Dec 2022 00:05:08 +0100 Subject: [PATCH 20/78] refactor: use Fifty.mp_frostbite as test mod only --- NorthstarDLL/verifiedmods.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 665c4d5dd..cb5a7613a 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -32,11 +32,7 @@ std::vector modsBeingDownloaded {}; // Test string used to test branch without masterserver const char* modsTestString = "{" - "\"Dinorush's LTS Rebalance\" : {\"DependencyPrefix\" : \"Dinorush-LTSRebalance\", \"Versions\" : []}, " - "\"Dinorush.Brute4\" : {\"DependencyPrefix\" : \"Dinorush-DinorushBrute4\", \"Versions\" : [ \"1.5\", \"1.6.0\" ]}, " - "\"Mod Settings\" : {\"DependencyPrefix\" : \"EladNLG-ModSettings\", \"Versions\" : [ \"1.0.0\", \"1.1.0\" ]}, " - "\"Moblin.Archon\" : {\"DependencyPrefix\" : \"GalacticMoblin-MoblinArchon\", \"Versions\" : [ \"1.3.0\", \"1.3.1\" ]}," - "\"Fifty.mp_frostbite\" : {\"DependencyPrefix\" : \"Fifty-Frostbite\", \"Versions\" : [ \"0.0.1\" ]}" + "\"Fifty.mp_frostbite\" : {\"DependencyPrefix\" : \"Fifty-Frostbite\", \"Versions\" : [ \"0.0.1\" ]}" "}"; From 126e97a890c78a68e5df06731d3933596b57b875 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Wed, 7 Dec 2022 00:12:47 +0100 Subject: [PATCH 21/78] refactor: add gotos REQUEST_END_CLEANUP in case something goes wrong --- NorthstarDLL/verifiedmods.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index cb5a7613a..8481214d9 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -147,8 +147,13 @@ void DownloadMod(char* modName, char* modVersion) std::thread requestThread( [dependencyString, modName]() { - std::string archiveName = (std::string)dependencyString + ".zip"; + // zip parsing variables + zip_int64_t num_entries; + int err = 0; + zip_t* zip; + // loading game path + std::string archiveName = (std::string)dependencyString + ".zip"; std::filesystem::path downloadPath = std::filesystem::temp_directory_path() / archiveName; CURL* curl = curl_easy_init(); @@ -176,31 +181,30 @@ void DownloadMod(char* modName, char* modVersion) else { spdlog::info("Fetching mod failed: {}", curl_easy_strerror(result)); - return; + goto REQUEST_END_CLEANUP; } // Unzip mods from downloaded archive. - int err = 0; - zip_t* zip = zip_open(downloadPath.generic_string().c_str(), ZIP_RDONLY, &err); + zip = zip_open(downloadPath.generic_string().c_str(), ZIP_RDONLY, &err); if (err != ZIP_ER_OK) { spdlog::error("Opening mod archive failed: {}", zip_strerror(zip)); - return; + goto REQUEST_END_CLEANUP; } spdlog::info("Starting extracting files from archive."); InitialiseNorthstarPrefix(); - zip_int64_t num_entries = zip_get_num_entries(zip, 0); + num_entries = zip_get_num_entries(zip, 0); for (zip_uint64_t i = 0; i < num_entries; ++i) { const char* name = zip_get_name(zip, i, 0); if (name == nullptr) { spdlog::error("Failed reading archive."); - return; + goto REQUEST_END_CLEANUP; } // Only extracting files that belong to mods. From 8a3ed78716da455674254497d7b02023bd7a1346 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Wed, 7 Dec 2022 00:28:12 +0100 Subject: [PATCH 22/78] docs: add TODO notes --- NorthstarDLL/verifiedmods.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 8481214d9..1451c0b01 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -195,8 +195,10 @@ void DownloadMod(char* modName, char* modVersion) spdlog::info("Starting extracting files from archive."); + // TODO why do we call this InitialiseNorthstarPrefix(); + // TODO detail zip format (no subfolders, but rather a list of files) num_entries = zip_get_num_entries(zip, 0); for (zip_uint64_t i = 0; i < num_entries; ++i) { @@ -208,6 +210,7 @@ void DownloadMod(char* modName, char* modVersion) } // Only extracting files that belong to mods. + // TODO detail a bit mod architecture maybe std::string modName = name; if (strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") { @@ -219,6 +222,7 @@ void DownloadMod(char* modName, char* modVersion) if (modName.back() == '/') { + // TODO catch errors std::filesystem::create_directory(destination); } else @@ -228,6 +232,8 @@ void DownloadMod(char* modName, char* modVersion) struct zip_file* zf = zip_fopen_index(zip, i, 0); std::ofstream writeStream(destination, std::ofstream::binary); + // TODO return if stream is not open + int sum = 0; int len = 0; char buf[100]; @@ -241,12 +247,12 @@ void DownloadMod(char* modName, char* modVersion) writeStream.close(); } } - - // TODO remove temporary folder REQUEST_END_CLEANUP: fclose(fp); modsBeingDownloaded.erase( std::remove(std::begin(modsBeingDownloaded), std::end(modsBeingDownloaded), modName) ); + // TODO close zip + // TODO remove temporary folder }); requestThread.detach(); } From 6c366c2c5696888b7859a3d032394eade3870661 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Thu, 8 Dec 2022 22:08:09 +0100 Subject: [PATCH 23/78] docs: add documentation to DownloadMod method --- NorthstarDLL/verifiedmods.cpp | 37 ++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 1451c0b01..859d92aef 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -48,8 +48,10 @@ const char* modsTestString = /** - * Fetches the list of verified mods from the master server, and store it in the verifiedModsJson variable. - * Since master server does not expose verified mods resource *yet*, this uses mods stored in the modsTestString variable. + * Fetches the list of verified mods from the master server, and store it in + * the verifiedModsJson variable. + * Since master server does not expose verified mods resource *yet*, this + * uses mods stored in the modsTestString variable. **/ void FetchVerifiedModsList() { @@ -70,8 +72,9 @@ void FetchVerifiedModsList() /** - * Checks if a mod is verified by controlling if its name matches a key in the verified mods JSON - * document, and if its version is included in the JSON versions list. + * Checks if a mod is verified by controlling if its name matches a key in the + * verified mods JSON document, and if its version is included in the JSON + * versions list. **/ bool IsModVerified(char* modName, char* modVersion) { @@ -104,7 +107,8 @@ bool IsModVerified(char* modName, char* modVersion) /** - * Tells if a mod is currently being downloaded by checking if its name is included in the `modsBeingDownloaded` variable. + * Tells if a mod is currently being downloaded by checking if its name is included + * in the `modsBeingDownloaded` variable. **/ bool IsModBeingDownloaded(char* modName) { @@ -195,10 +199,18 @@ void DownloadMod(char* modName, char* modVersion) spdlog::info("Starting extracting files from archive."); - // TODO why do we call this + // This will extract the archive contents into game folder, so we need + // to ensure Northstar installation folder has been loaded in memory. InitialiseNorthstarPrefix(); - // TODO detail zip format (no subfolders, but rather a list of files) + // `zip_get_name` returns a file name among files contained in the archive; + // file names are organized as a list that has the following format: + // * archive.zip/icon.png + // * archive.zip/manifest.json + // * archive.zip/mods/ + // * archive.zip/mods/firstMod/ + // * archive.zip/mods/firstMod/mod.json + // etc. num_entries = zip_get_num_entries(zip, 0); for (zip_uint64_t i = 0; i < num_entries; ++i) { @@ -209,9 +221,16 @@ void DownloadMod(char* modName, char* modVersion) goto REQUEST_END_CLEANUP; } - // Only extracting files that belong to mods. - // TODO detail a bit mod architecture maybe std::string modName = name; + + // Only extracting files that belong to mods. + // + // We don't need to recreate the mods/ directory, as it should already + // exist in a R2Northstar installation. + // + // A well-formatted Thunderstore archive contains files such as icon.png, + // manifest.json and README.md; we don't want to extract those, but only + // the content of the mods/ directory. if (strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") { continue; From 4cba187c84615c0f36f06965e72f76cbe2166d7d Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Fri, 9 Dec 2022 01:10:07 +0100 Subject: [PATCH 24/78] refactor: encapsulate versions in objects --- NorthstarDLL/verifiedmods.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 859d92aef..6db6a6a47 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -32,7 +32,11 @@ std::vector modsBeingDownloaded {}; // Test string used to test branch without masterserver const char* modsTestString = "{" - "\"Fifty.mp_frostbite\" : {\"DependencyPrefix\" : \"Fifty-Frostbite\", \"Versions\" : [ \"0.0.1\" ]}" + "\"Fifty.mp_frostbite\": {" + "\"DependencyPrefix\": \"Fifty-Frostbite\"," + "\"Versions\" : [" + "{ \"Version\": \"0.0.1\" }" + "]}" "}"; @@ -93,8 +97,9 @@ bool IsModVerified(char* modName, char* modVersion) for (rapidjson::Value::ConstValueIterator iterator = versions.Begin(); iterator != versions.End(); iterator++) { - const rapidjson::Value& version = *iterator; - if (strcmp(version.GetString(), modVersion) == 0) + const Value& currentModVersion = *iterator; + const auto currentVersionText = currentModVersion["Version"].GetString(); + if (strcmp(currentVersionText, modVersion) == 0) { spdlog::info("Mod \"{}\" (version {}) is verified.", modName, modVersion); return true; From 7b370c2aafcd83aafe1a4a33ecbf058bb1b54193 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 11 Dec 2022 22:49:07 +0100 Subject: [PATCH 25/78] build: update lib import in zip.h --- include/libzip/include/zip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libzip/include/zip.h b/include/libzip/include/zip.h index 283607a5a..5b785e7d3 100644 --- a/include/libzip/include/zip.h +++ b/include/libzip/include/zip.h @@ -42,7 +42,7 @@ extern "C" { #endif #endif -#include +#include "zipconf.h" #ifndef ZIP_EXTERN #ifndef ZIP_STATIC From 60f1d6195609b5316fa5a64e31a05124a45b6bd8 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 11 Dec 2022 22:55:23 +0100 Subject: [PATCH 26/78] style: format file --- NorthstarDLL/verifiedmods.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 859d92aef..72a3a83ee 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -11,8 +11,6 @@ using namespace rapidjson; - - /* ██████╗ ██╗ ██████╗ ██████╗ █████╗ ██╗ ██╗ ██╗ █████╗ ██████╗ ██╗ █████╗ ██████╗ ██╗ ███████╗███████╗ ██╔════╝ ██║ ██╔═══██╗██╔══██╗██╔══██╗██║ ██║ ██║██╔══██╗██╔══██╗██║██╔══██╗██╔══██╗██║ ██╔════╝██╔════╝ @@ -22,7 +20,6 @@ using namespace rapidjson; ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚══════╝╚══════╝ */ - // This JSON contains all verified mods. Document verifiedModsJson; @@ -30,12 +27,9 @@ Document verifiedModsJson; std::vector modsBeingDownloaded {}; // Test string used to test branch without masterserver -const char* modsTestString = - "{" - "\"Fifty.mp_frostbite\" : {\"DependencyPrefix\" : \"Fifty-Frostbite\", \"Versions\" : [ \"0.0.1\" ]}" - "}"; - - +const char* modsTestString = "{" + "\"Fifty.mp_frostbite\" : {\"DependencyPrefix\" : \"Fifty-Frostbite\", \"Versions\" : [ \"0.0.1\" ]}" + "}"; /* ███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ███████╗ @@ -46,7 +40,6 @@ const char* modsTestString = ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ */ - /** * Fetches the list of verified mods from the master server, and store it in * the verifiedModsJson variable. @@ -70,7 +63,6 @@ void FetchVerifiedModsList() requestThread.detach(); } - /** * Checks if a mod is verified by controlling if its name matches a key in the * verified mods JSON document, and if its version is included in the JSON @@ -105,7 +97,6 @@ bool IsModVerified(char* modName, char* modVersion) return false; } - /** * Tells if a mod is currently being downloaded by checking if its name is included * in the `modsBeingDownloaded` variable. @@ -115,7 +106,6 @@ bool IsModBeingDownloaded(char* modName) return std::find(modsBeingDownloaded.begin(), modsBeingDownloaded.end(), modName) != modsBeingDownloaded.end(); } - /** * cURL method to write data to disk. **/ @@ -139,7 +129,7 @@ size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) **/ void DownloadMod(char* modName, char* modVersion) { - modsBeingDownloaded.push_back( modName ); + modsBeingDownloaded.push_back(modName); // Rebuild mod dependency string. const Value& entry = verifiedModsJson[modName]; @@ -159,7 +149,7 @@ void DownloadMod(char* modName, char* modVersion) // loading game path std::string archiveName = (std::string)dependencyString + ".zip"; std::filesystem::path downloadPath = std::filesystem::temp_directory_path() / archiveName; - + CURL* curl = curl_easy_init(); FILE* fp = fopen(downloadPath.generic_string().c_str(), "wb"); CURLcode result; @@ -172,7 +162,7 @@ void DownloadMod(char* modName, char* modVersion) curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); - + spdlog::info("Fetching mod {} from Thunderstore...", dependencyString); result = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -227,7 +217,7 @@ void DownloadMod(char* modName, char* modVersion) // // We don't need to recreate the mods/ directory, as it should already // exist in a R2Northstar installation. - // + // // A well-formatted Thunderstore archive contains files such as icon.png, // manifest.json and README.md; we don't want to extract those, but only // the content of the mods/ directory. @@ -269,15 +259,13 @@ void DownloadMod(char* modName, char* modVersion) REQUEST_END_CLEANUP: fclose(fp); - modsBeingDownloaded.erase( std::remove(std::begin(modsBeingDownloaded), std::end(modsBeingDownloaded), modName) ); + modsBeingDownloaded.erase(std::remove(std::begin(modsBeingDownloaded), std::end(modsBeingDownloaded), modName)); // TODO close zip // TODO remove temporary folder }); requestThread.detach(); } - - /* ███████╗ ██████╗ ██╗ ██╗██╗██████╗ ██████╗ ███████╗██╗ ███████╗██╗ ██╗██████╗ ██████╗ ███████╗███████╗██████╗ ██╔════╝██╔═══██╗██║ ██║██║██╔══██╗██╔══██╗██╔════╝██║ ██╔════╝╚██╗██╔╝██╔══██╗██╔═══██╗██╔════╝██╔════╝██╔══██╗ @@ -294,7 +282,6 @@ void DownloadMod(char* modName, char* modVersion) ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ */ - ADD_SQFUNC("string", NSFetchVerifiedModsList, "", "", ScriptContext::UI) { FetchVerifiedModsList(); From 8fc2159c08e15a87c0b48ded903f66bc7a8a78e0 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Tue, 13 Dec 2022 18:57:46 +0100 Subject: [PATCH 27/78] style: format --- NorthstarDLL/verifiedmods.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 210cd87b5..2605e63e9 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -27,15 +27,13 @@ Document verifiedModsJson; std::vector modsBeingDownloaded {}; // Test string used to test branch without masterserver -const char* modsTestString = - "{" - "\"Fifty.mp_frostbite\": {" - "\"DependencyPrefix\": \"Fifty-Frostbite\"," - "\"Versions\" : [" - "{ \"Version\": \"0.0.1\" }" - "]}" - "}"; - +const char* modsTestString = "{" + "\"Fifty.mp_frostbite\": {" + "\"DependencyPrefix\": \"Fifty-Frostbite\"," + "\"Versions\" : [" + "{ \"Version\": \"0.0.1\" }" + "]}" + "}"; /* ███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ███████╗ From b3cecba9194db7370321c20196929fc923e78035 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Mon, 26 Dec 2022 22:17:06 +0100 Subject: [PATCH 28/78] feat: save current download progress in a local float --- NorthstarDLL/verifiedmods.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index a0e82e146..9ca21f681 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -25,6 +25,7 @@ Document verifiedModsJson; // This list holds the names of all mods that are currently being downloaded. std::vector modsBeingDownloaded {}; +float currentDownloadProgress = 0; // Test string used to test branch without masterserver const char* modsTestString = "{" @@ -121,6 +122,20 @@ size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) return written; } +/** + * cURL method to follow download progression. + **/ +int progress_callback(void* ptr, curl_off_t totalDownloadSize, curl_off_t finishedDownloadSize, curl_off_t totalToUpload, curl_off_t nowUploaded) +{ + if (totalDownloadSize != 0 && finishedDownloadSize != 0) + { + currentDownloadProgress = static_cast(finishedDownloadSize) / totalDownloadSize; + spdlog::info(" => Download progress: {}", currentDownloadProgress); + } + + return 0; +} + /** * Downloads a given mod from Thunderstore API to local game folder. * This is done following these steps: @@ -167,9 +182,12 @@ void DownloadMod(char* modName, char* modVersion) curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data); curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L); + curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback); spdlog::info("Fetching mod {} from Thunderstore...", dependencyString); result = curl_easy_perform(curl); + currentDownloadProgress = 0; curl_easy_cleanup(curl); if (result == CURLcode::CURLE_OK) From 7c6ac2653b4c9bb36420af878f7fac662f5abc19 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Mon, 26 Dec 2022 22:29:25 +0100 Subject: [PATCH 29/78] feat: format download progress (keeping two decimals) --- NorthstarDLL/verifiedmods.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 9ca21f681..ab62bb092 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -129,8 +129,8 @@ int progress_callback(void* ptr, curl_off_t totalDownloadSize, curl_off_t finish { if (totalDownloadSize != 0 && finishedDownloadSize != 0) { - currentDownloadProgress = static_cast(finishedDownloadSize) / totalDownloadSize; - spdlog::info(" => Download progress: {}", currentDownloadProgress); + currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize *100); + spdlog::info(" => Download progress: {}%", currentDownloadProgress); } return 0; From 6b4ed4e7c5944f394f92641ce53c41d63da644ee Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Mon, 26 Dec 2022 22:54:30 +0100 Subject: [PATCH 30/78] feat: expose download progression to Squirrel VM --- NorthstarDLL/verifiedmods.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index ab62bb092..134d0e2ae 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -332,6 +332,12 @@ ADD_SQFUNC("bool", NSIsModBeingDownloaded, "string modName", "", ScriptContext:: return SQRESULT_NOTNULL; } +ADD_SQFUNC("float", NSGetCurrentDownloadProgress, "", "", ScriptContext::UI) +{ + g_pSquirrel->pushfloat(sqvm, currentDownloadProgress); + return SQRESULT_NOTNULL; +} + ADD_SQFUNC("void", NSDownloadMod, "string modName, string modVersion", "", ScriptContext::UI) { const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); From 6f16e63de696f27cc7ad1002ed13b78b1df1c157 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Mon, 26 Dec 2022 22:56:13 +0100 Subject: [PATCH 31/78] fix: reset download progress before starting mod download --- NorthstarDLL/verifiedmods.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 134d0e2ae..a8c1020ab 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -186,8 +186,8 @@ void DownloadMod(char* modName, char* modVersion) curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback); spdlog::info("Fetching mod {} from Thunderstore...", dependencyString); - result = curl_easy_perform(curl); currentDownloadProgress = 0; + result = curl_easy_perform(curl); curl_easy_cleanup(curl); if (result == CURLcode::CURLE_OK) From e5ba7922c4b2242e889707d43284a370c6a45a5b Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Mon, 26 Dec 2022 23:33:08 +0100 Subject: [PATCH 32/78] style: format code --- NorthstarDLL/verifiedmods.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index a8c1020ab..3d38a1a53 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -123,13 +123,14 @@ size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) } /** - * cURL method to follow download progression. + * cURL method to follow download progression. **/ -int progress_callback(void* ptr, curl_off_t totalDownloadSize, curl_off_t finishedDownloadSize, curl_off_t totalToUpload, curl_off_t nowUploaded) +int progress_callback( + void* ptr, curl_off_t totalDownloadSize, curl_off_t finishedDownloadSize, curl_off_t totalToUpload, curl_off_t nowUploaded) { if (totalDownloadSize != 0 && finishedDownloadSize != 0) { - currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize *100); + currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize * 100); spdlog::info(" => Download progress: {}%", currentDownloadProgress); } From c392219137c1255b16feb6d12fdb4628575129a4 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Tue, 27 Dec 2022 21:12:18 +0100 Subject: [PATCH 33/78] refactor: send download stats to VM --- NorthstarDLL/verifiedmods.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 3d38a1a53..94853f1f9 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -25,7 +25,7 @@ Document verifiedModsJson; // This list holds the names of all mods that are currently being downloaded. std::vector modsBeingDownloaded {}; -float currentDownloadProgress = 0; +std::vector currentDownloadStats(3); // Test string used to test branch without masterserver const char* modsTestString = "{" @@ -130,8 +130,9 @@ int progress_callback( { if (totalDownloadSize != 0 && finishedDownloadSize != 0) { - currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize * 100); + auto currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize * 100); spdlog::info(" => Download progress: {}%", currentDownloadProgress); + currentDownloadStats = {static_cast(finishedDownloadSize), static_cast(totalDownloadSize), currentDownloadProgress}; } return 0; @@ -187,7 +188,7 @@ void DownloadMod(char* modName, char* modVersion) curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback); spdlog::info("Fetching mod {} from Thunderstore...", dependencyString); - currentDownloadProgress = 0; + currentDownloadStats = {0, 100, 0}; result = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -333,9 +334,17 @@ ADD_SQFUNC("bool", NSIsModBeingDownloaded, "string modName", "", ScriptContext:: return SQRESULT_NOTNULL; } -ADD_SQFUNC("float", NSGetCurrentDownloadProgress, "", "", ScriptContext::UI) +ADD_SQFUNC("array", NSGetCurrentDownloadProgress, "", "", ScriptContext::UI) { - g_pSquirrel->pushfloat(sqvm, currentDownloadProgress); + g_pSquirrel->newarray(sqvm, 0); + + g_pSquirrel->pushfloat(sqvm, currentDownloadStats[0]); + g_pSquirrel->arrayappend(sqvm, -2); + g_pSquirrel->pushfloat(sqvm, currentDownloadStats[1]); + g_pSquirrel->arrayappend(sqvm, -2); + g_pSquirrel->pushfloat(sqvm, currentDownloadStats[2]); + g_pSquirrel->arrayappend(sqvm, -2); + return SQRESULT_NOTNULL; } From 6dbc5e7380825fe412e25a8c2f82ab89253106be Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Tue, 27 Dec 2022 21:12:57 +0100 Subject: [PATCH 34/78] test: add Zircon Spitfire to verified mods list --- NorthstarDLL/verifiedmods.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 94853f1f9..ff2a2dd76 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -33,6 +33,12 @@ const char* modsTestString = "{" "\"DependencyPrefix\": \"Fifty-Frostbite\"," "\"Versions\" : [" "{ \"Version\": \"0.0.1\" }" + "]}," + + "\"Zircon Spitfire\": {" + "\"DependencyPrefix\": \"Juicys_Emporium-Zircon_Spitfire\"," + "\"Versions\" : [" + "{ \"Version\": \"1.0.0\" }" "]}" "}"; From aa8c1172b6b4706dab81be97e5c252270e0714ae Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Tue, 27 Dec 2022 23:20:57 +0100 Subject: [PATCH 35/78] feat: send zip extraction stats to VM --- NorthstarDLL/verifiedmods.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index ff2a2dd76..5c46289d8 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -25,7 +25,7 @@ Document verifiedModsJson; // This list holds the names of all mods that are currently being downloaded. std::vector modsBeingDownloaded {}; -std::vector currentDownloadStats(3); +std::vector currentDownloadStats(4); // Test string used to test branch without masterserver const char* modsTestString = "{" @@ -138,7 +138,7 @@ int progress_callback( { auto currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize * 100); spdlog::info(" => Download progress: {}%", currentDownloadProgress); - currentDownloadStats = {static_cast(finishedDownloadSize), static_cast(totalDownloadSize), currentDownloadProgress}; + currentDownloadStats = {static_cast(finishedDownloadSize), static_cast(totalDownloadSize), currentDownloadProgress, 0}; } return 0; @@ -194,7 +194,7 @@ void DownloadMod(char* modName, char* modVersion) curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback); spdlog::info("Fetching mod {} from Thunderstore...", dependencyString); - currentDownloadStats = {0, 100, 0}; + currentDownloadStats = {0, 100, 0, 0}; result = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -233,6 +233,10 @@ void DownloadMod(char* modName, char* modVersion) // * archive.zip/mods/firstMod/mod.json // etc. num_entries = zip_get_num_entries(zip, 0); + + // Update current statistics to display extraction progress. + currentDownloadStats = {0, static_cast(num_entries), 0, 1}; + for (zip_uint64_t i = 0; i < num_entries; ++i) { const char* name = zip_get_name(zip, i, 0); @@ -286,6 +290,11 @@ void DownloadMod(char* modName, char* modVersion) } writeStream.close(); } + + // Sets first statistics field to the count of extracted files, and update + // progression percentage accordingly. + currentDownloadStats[0] = static_cast(i); + currentDownloadStats[2] = roundf(currentDownloadStats[0] / currentDownloadStats[1] * 100); } REQUEST_END_CLEANUP: @@ -350,6 +359,8 @@ ADD_SQFUNC("array", NSGetCurrentDownloadProgress, "", "", ScriptContext:: g_pSquirrel->arrayappend(sqvm, -2); g_pSquirrel->pushfloat(sqvm, currentDownloadStats[2]); g_pSquirrel->arrayappend(sqvm, -2); + g_pSquirrel->pushfloat(sqvm, currentDownloadStats[3]); + g_pSquirrel->arrayappend(sqvm, -2); return SQRESULT_NOTNULL; } From c8195bbea44232a1314385b1acf1e9bfc03bab76 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Tue, 27 Dec 2022 23:51:34 +0100 Subject: [PATCH 36/78] feat: send big files extraction progress to VM --- NorthstarDLL/verifiedmods.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 5c46289d8..656f84e91 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -25,7 +25,7 @@ Document verifiedModsJson; // This list holds the names of all mods that are currently being downloaded. std::vector modsBeingDownloaded {}; -std::vector currentDownloadStats(4); +std::vector currentDownloadStats(6); // Test string used to test branch without masterserver const char* modsTestString = "{" @@ -138,7 +138,7 @@ int progress_callback( { auto currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize * 100); spdlog::info(" => Download progress: {}%", currentDownloadProgress); - currentDownloadStats = {static_cast(finishedDownloadSize), static_cast(totalDownloadSize), currentDownloadProgress, 0}; + currentDownloadStats = {static_cast(finishedDownloadSize), static_cast(totalDownloadSize), currentDownloadProgress, 0, 0, 0}; } return 0; @@ -194,7 +194,7 @@ void DownloadMod(char* modName, char* modVersion) curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback); spdlog::info("Fetching mod {} from Thunderstore...", dependencyString); - currentDownloadStats = {0, 100, 0, 0}; + currentDownloadStats = {0, 100, 0, 0, 0, 0}; result = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -235,7 +235,7 @@ void DownloadMod(char* modName, char* modVersion) num_entries = zip_get_num_entries(zip, 0); // Update current statistics to display extraction progress. - currentDownloadStats = {0, static_cast(num_entries), 0, 1}; + currentDownloadStats = {0, static_cast(num_entries), 0, 1, 0, 0}; for (zip_uint64_t i = 0; i < num_entries; ++i) { @@ -282,11 +282,17 @@ void DownloadMod(char* modName, char* modVersion) int len = 0; char buf[100]; + // Sets first statistics field to the count of extracted files, and update + // progression percentage accordingly. + currentDownloadStats[4] = 0; + currentDownloadStats[5] = static_cast(sb.size); + while (sum != sb.size) { len = zip_fread(zf, buf, 100); writeStream.write((char*)buf, len); sum += len; + currentDownloadStats[4] = static_cast(sum); } writeStream.close(); } @@ -361,6 +367,10 @@ ADD_SQFUNC("array", NSGetCurrentDownloadProgress, "", "", ScriptContext:: g_pSquirrel->arrayappend(sqvm, -2); g_pSquirrel->pushfloat(sqvm, currentDownloadStats[3]); g_pSquirrel->arrayappend(sqvm, -2); + g_pSquirrel->pushfloat(sqvm, currentDownloadStats[4]); + g_pSquirrel->arrayappend(sqvm, -2); + g_pSquirrel->pushfloat(sqvm, currentDownloadStats[5]); + g_pSquirrel->arrayappend(sqvm, -2); return SQRESULT_NOTNULL; } From 23840777fc8ef44001ba8a8ed2c0b0e9f9133aa1 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Tue, 27 Dec 2022 23:58:16 +0100 Subject: [PATCH 37/78] docs: add documentation to currentDownloadStats variable --- NorthstarDLL/verifiedmods.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 656f84e91..9b3f6a017 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -25,6 +25,17 @@ Document verifiedModsJson; // This list holds the names of all mods that are currently being downloaded. std::vector modsBeingDownloaded {}; + +// This vector holds information about the currently downloaded mod: +// 1. received quantity +// 2. total quantity expected +// 3. ratio of received / expected (computed in native for PERFS!) +// 4. nature of previous data (0=download stats [in MBs], 1=extraction stats [in files count]) +// +// The following information should only be used with big files (as there's no need to display this +// for small files due to extraction speed): +// 5. extracted size of current file +// 6. total size of current file std::vector currentDownloadStats(6); // Test string used to test branch without masterserver @@ -138,7 +149,8 @@ int progress_callback( { auto currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize * 100); spdlog::info(" => Download progress: {}%", currentDownloadProgress); - currentDownloadStats = {static_cast(finishedDownloadSize), static_cast(totalDownloadSize), currentDownloadProgress, 0, 0, 0}; + currentDownloadStats = { + static_cast(finishedDownloadSize), static_cast(totalDownloadSize), currentDownloadProgress, 0, 0, 0}; } return 0; From b6ebce7dea9cba06f448d0e4d95b5d8f372011c9 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Wed, 28 Dec 2022 00:13:36 +0100 Subject: [PATCH 38/78] style: only assign changing vector elements + send vector to VM using a loop --- NorthstarDLL/verifiedmods.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 9b3f6a017..8a1757060 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -149,8 +149,9 @@ int progress_callback( { auto currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize * 100); spdlog::info(" => Download progress: {}%", currentDownloadProgress); - currentDownloadStats = { - static_cast(finishedDownloadSize), static_cast(totalDownloadSize), currentDownloadProgress, 0, 0, 0}; + currentDownloadStats[0] = static_cast(finishedDownloadSize); + currentDownloadStats[1] = static_cast(totalDownloadSize); + currentDownloadStats[2] = static_cast(currentDownloadProgress); } return 0; @@ -206,7 +207,7 @@ void DownloadMod(char* modName, char* modVersion) curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_callback); spdlog::info("Fetching mod {} from Thunderstore...", dependencyString); - currentDownloadStats = {0, 100, 0, 0, 0, 0}; + currentDownloadStats = {0, 0, 0, 0, 0, 0}; result = curl_easy_perform(curl); curl_easy_cleanup(curl); @@ -371,18 +372,11 @@ ADD_SQFUNC("array", NSGetCurrentDownloadProgress, "", "", ScriptContext:: { g_pSquirrel->newarray(sqvm, 0); - g_pSquirrel->pushfloat(sqvm, currentDownloadStats[0]); - g_pSquirrel->arrayappend(sqvm, -2); - g_pSquirrel->pushfloat(sqvm, currentDownloadStats[1]); - g_pSquirrel->arrayappend(sqvm, -2); - g_pSquirrel->pushfloat(sqvm, currentDownloadStats[2]); - g_pSquirrel->arrayappend(sqvm, -2); - g_pSquirrel->pushfloat(sqvm, currentDownloadStats[3]); - g_pSquirrel->arrayappend(sqvm, -2); - g_pSquirrel->pushfloat(sqvm, currentDownloadStats[4]); - g_pSquirrel->arrayappend(sqvm, -2); - g_pSquirrel->pushfloat(sqvm, currentDownloadStats[5]); - g_pSquirrel->arrayappend(sqvm, -2); + for (float value : currentDownloadStats) + { + g_pSquirrel->pushfloat(sqvm, value); + g_pSquirrel->arrayappend(sqvm, -2); + } return SQRESULT_NOTNULL; } From 174285abac669d3ed49436a78d428be5cd98259b Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Thu, 29 Dec 2022 00:09:47 +0100 Subject: [PATCH 39/78] refactor: remove file download progress log (because too many entries) --- NorthstarDLL/verifiedmods.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 8a1757060..ec2c4384f 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -148,7 +148,6 @@ int progress_callback( if (totalDownloadSize != 0 && finishedDownloadSize != 0) { auto currentDownloadProgress = roundf(static_cast(finishedDownloadSize) / totalDownloadSize * 100); - spdlog::info(" => Download progress: {}%", currentDownloadProgress); currentDownloadStats[0] = static_cast(finishedDownloadSize); currentDownloadStats[1] = static_cast(totalDownloadSize); currentDownloadStats[2] = static_cast(currentDownloadProgress); From c27e3163f272472e60e44e8f8afa794340bf7026 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Thu, 29 Dec 2022 00:17:00 +0100 Subject: [PATCH 40/78] feat: add a log entry to mark mod's successful extraction --- NorthstarDLL/verifiedmods.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index ec2c4384f..f0115f622 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -315,6 +315,8 @@ void DownloadMod(char* modName, char* modVersion) currentDownloadStats[2] = roundf(currentDownloadStats[0] / currentDownloadStats[1] * 100); } + spdlog::info("Mod successfully extracted."); + REQUEST_END_CLEANUP: fclose(fp); modsBeingDownloaded.erase(std::remove(std::begin(modsBeingDownloaded), std::end(modsBeingDownloaded), modName)); From 4ee0cc047ca2bc9130b52063980d4e05411f4200 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Thu, 29 Dec 2022 14:51:49 +0100 Subject: [PATCH 41/78] feat: extraction progress is updated with extracted content Previously, extraction progress would not move while extracting big files because it was using extracted files (e.g. 10/13 files); it's now using extracted bytes count. --- NorthstarDLL/verifiedmods.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index f0115f622..6cb21cdd4 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -185,6 +185,9 @@ void DownloadMod(char* modName, char* modVersion) zip_int64_t num_entries; int err = 0; zip_t* zip; + struct zip_stat sb; + int totalSize = 0; + int extractedSize = 0; // loading game path std::string archiveName = (std::string)dependencyString + ".zip"; @@ -248,7 +251,23 @@ void DownloadMod(char* modName, char* modVersion) // Update current statistics to display extraction progress. currentDownloadStats = {0, static_cast(num_entries), 0, 1, 0, 0}; + + // Compute total size of archive by looping over its files. + for (zip_uint64_t i = 0; i < num_entries; ++i) + { + const char* name = zip_get_name(zip, i, 0); + std::string modName = name; + if (modName.back() == '/' || strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") + { + continue; + } + + struct zip_stat sb; + zip_stat_index(zip, i, 0, &sb); + totalSize += sb.size; + } + // Start unzipping archive. for (zip_uint64_t i = 0; i < num_entries; ++i) { const char* name = zip_get_name(zip, i, 0); @@ -304,15 +323,17 @@ void DownloadMod(char* modName, char* modVersion) len = zip_fread(zf, buf, 100); writeStream.write((char*)buf, len); sum += len; + extractedSize += len; currentDownloadStats[4] = static_cast(sum); + currentDownloadStats[2] = roundf(static_cast(extractedSize) / totalSize * 100); } writeStream.close(); } // Sets first statistics field to the count of extracted files, and update - // progression percentage accordingly. + // progression percentage regarding extracted content size. currentDownloadStats[0] = static_cast(i); - currentDownloadStats[2] = roundf(currentDownloadStats[0] / currentDownloadStats[1] * 100); + currentDownloadStats[2] = roundf(static_cast(extractedSize) / totalSize * 100); } spdlog::info("Mod successfully extracted."); From 3b3c4fe2cb11adf364e4e04e3e72aa94b758e5d4 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Thu, 29 Dec 2022 21:59:44 +0100 Subject: [PATCH 42/78] refactor: export total size computation outside of thread --- NorthstarDLL/verifiedmods.cpp | 44 +++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 6cb21cdd4..87e2b817b 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -156,6 +156,32 @@ int progress_callback( return 0; } +/** + * Returns uncompressed size of all mod files from a Thunderstore archive. + * This excludes all Thunderstore-related files. + **/ +int get_mod_archive_content_size(zip_t* zip) +{ + int totalSize = 0; + int num_entries = zip_get_num_entries(zip, 0); + + for (zip_uint64_t i = 0; i < num_entries; ++i) + { + const char* name = zip_get_name(zip, i, 0); + std::string modName = name; + if (modName.back() == '/' || strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") + { + continue; + } + + struct zip_stat sb; + zip_stat_index(zip, i, 0, &sb); + totalSize += sb.size; + } + + return totalSize; +} + /** * Downloads a given mod from Thunderstore API to local game folder. * This is done following these steps: @@ -249,23 +275,11 @@ void DownloadMod(char* modName, char* modVersion) // etc. num_entries = zip_get_num_entries(zip, 0); - // Update current statistics to display extraction progress. + // Update current statistics to display files extraction progress. currentDownloadStats = {0, static_cast(num_entries), 0, 1, 0, 0}; - - // Compute total size of archive by looping over its files. - for (zip_uint64_t i = 0; i < num_entries; ++i) - { - const char* name = zip_get_name(zip, i, 0); - std::string modName = name; - if (modName.back() == '/' || strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") - { - continue; - } - struct zip_stat sb; - zip_stat_index(zip, i, 0, &sb); - totalSize += sb.size; - } + // Compute total mod size to update extraction progress. + totalSize = get_mod_archive_content_size(zip); // Start unzipping archive. for (zip_uint64_t i = 0; i < num_entries; ++i) From 41b81d859fcf53fa63cc30525cd09439107cac08 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sat, 31 Dec 2022 00:02:38 +0100 Subject: [PATCH 43/78] feat: add code skeleton to check downloaded archive checksum --- NorthstarDLL/verifiedmods.cpp | 106 +++++++++++++++++++++++++++++----- 1 file changed, 92 insertions(+), 14 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 87e2b817b..06ff810a7 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -8,6 +8,8 @@ #include "libzip/include/zip.h" #include #include "config/profile.h" +#include "openssl/evp.h" +#include "openssl/sha.h" using namespace rapidjson; @@ -39,19 +41,20 @@ std::vector modsBeingDownloaded {}; std::vector currentDownloadStats(6); // Test string used to test branch without masterserver -const char* modsTestString = "{" - "\"Fifty.mp_frostbite\": {" - "\"DependencyPrefix\": \"Fifty-Frostbite\"," - "\"Versions\" : [" - "{ \"Version\": \"0.0.1\" }" - "]}," - - "\"Zircon Spitfire\": {" - "\"DependencyPrefix\": \"Juicys_Emporium-Zircon_Spitfire\"," - "\"Versions\" : [" - "{ \"Version\": \"1.0.0\" }" - "]}" - "}"; +const char* modsTestString = + "{" + "\"Fifty.mp_frostbite\": {" + "\"DependencyPrefix\": \"Fifty-Frostbite\"," + "\"Versions\" : [" + "{ \"Version\": \"0.0.1\", \"Checksum\": \"8cf111c9ac2ab1521677769702e10be4db8d47c0eca16bda197aceb895cf2b5c\" }" + "]}," + + "\"Zircon Spitfire\": {" + "\"DependencyPrefix\": \"Juicys_Emporium-Zircon_Spitfire\"," + "\"Versions\" : [" + "{ \"Version\": \"1.0.0\", \"Checksum\": \"b742d09832a97bdbbd6b9184884712ef4093e3b4ba29eae40b40db26308ba42e\" }" + "]}" + "}"; /* ███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ███████╗ @@ -182,6 +185,55 @@ int get_mod_archive_content_size(zip_t* zip) return totalSize; } +/** + * sha256 code shamelessly stolen from https://stackoverflow.com/a/74671723/11243782 + **/ +bool check_mod_archive_checksum(std::filesystem::path path, std::string expectedHash) +{ + auto sha256 = [](std::string fname, std::vector& hash) -> bool + { + std::unique_ptr evpCtx(EVP_MD_CTX_new(), EVP_MD_CTX_free); + EVP_DigestInit_ex(evpCtx.get(), EVP_sha256(), nullptr); + + constexpr size_t buffer_size {1 << 12}; + std::vector buffer(buffer_size, '\0'); + + std::ifstream fp(fname, std::ios::binary); + if (!fp.is_open()) + { + spdlog::error("Unable to open {}.", fname); + return false; + } + while (fp.good()) + { + fp.read(buffer.data(), buffer_size); + EVP_DigestUpdate(evpCtx.get(), buffer.data(), fp.gcount()); + } + fp.close(); + + hash.resize(SHA256_DIGEST_LENGTH); + std::fill(hash.begin(), hash.end(), 0); + unsigned int len; + EVP_DigestFinal_ex(evpCtx.get(), hash.data(), &len); + + return true; + }; + + // Compute hash of downloaded archive. + std::vector hash; + if (!sha256(path.generic_string(), hash)) + { + return false; + } + std::stringstream out; + for (size_t i = 0; i < hash.size(); i++) + out << std::setfill('0') << std::setw(2) << std::hex << int(hash[i]); + std::string archiveHash = out.str(); + + // Compare computed hash with expected hash. + return strcmp(archiveHash.c_str(), expectedHash.c_str()) == 0; +} + /** * Downloads a given mod from Thunderstore API to local game folder. * This is done following these steps: @@ -204,8 +256,26 @@ void DownloadMod(char* modName, char* modVersion) dependencyString.append("-"); dependencyString.append(modVersion); + // Get expected checksum. + std::string modChecksum = ""; + for (rapidjson::Value::ConstValueIterator iterator = versions.Begin(); iterator != versions.End(); iterator++) + { + const Value& currentModVersion = *iterator; + const auto currentVersionText = currentModVersion["Version"].GetString(); + if (strcmp(currentVersionText, modVersion) == 0) + { + modChecksum = currentModVersion["Checksum"].GetString(); + break; + } + } + if (modChecksum.empty()) + { + spdlog::error("Failed to load expected archive checksum."); + return; + } + std::thread requestThread( - [dependencyString, modName]() + [dependencyString, modName, modChecksum]() { // zip parsing variables zip_int64_t num_entries; @@ -250,6 +320,14 @@ void DownloadMod(char* modName, char* modVersion) goto REQUEST_END_CLEANUP; } + // Verify checksum of downloaded archive. + if (check_mod_archive_checksum(downloadPath, modChecksum)) + { + spdlog::error("Archive checksum does not match verified hash."); + goto REQUEST_END_CLEANUP; + } + spdlog::error("Checksum OK!"); + // Unzip mods from downloaded archive. zip = zip_open(downloadPath.generic_string().c_str(), ZIP_RDONLY, &err); From 1c4c3e98d3835e489fdd5728c3e82a2046365338 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 3 Jan 2023 03:17:02 +0100 Subject: [PATCH 44/78] build: add openssl libraries to linker inputs --- NorthstarDLL/NorthstarDLL.vcxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj index 548343665..6a9ae7649 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj +++ b/NorthstarDLL/NorthstarDLL.vcxproj @@ -69,7 +69,7 @@ Windows true false - $(SolutionDir)include\MinHook.x64.lib;$(SolutionDir)include\libcurl\lib\libcurl_a.lib;$(SolutionDir)include\libzip\lib\zip.lib;$(SolutionDir)include\libzip\lib\zlib.lib;$(SolutionDir)include\libzip\lib\bz2.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies) + $(SolutionDir)include\MinHook.x64.lib;$(SolutionDir)include\libcrypto_static.lib;$(SolutionDir)include\libssl_static.lib;$(SolutionDir)include\libcurl\lib\libcurl_a.lib;$(SolutionDir)include\libzip\lib\zip.lib;$(SolutionDir)include\libzip\lib\zlib.lib;$(SolutionDir)include\libzip\lib\bz2.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies) %(AdditionalLibraryDirectories) @@ -104,7 +104,7 @@ true true false - $(SolutionDir)include\MinHook.x64.lib;$(SolutionDir)include\libcurl\lib\libcurl_a.lib;$(SolutionDir)include\libzip\lib\zip.lib;$(SolutionDir)include\libzip\lib\zlib.lib;$(SolutionDir)include\libzip\lib\bz2.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies) + $(SolutionDir)include\MinHook.x64.lib;$(SolutionDir)include\libcrypto_static.lib;$(SolutionDir)include\libssl_static.lib;$(SolutionDir)include\libcurl\lib\libcurl_a.lib;$(SolutionDir)include\libzip\lib\zip.lib;$(SolutionDir)include\libzip\lib\zlib.lib;$(SolutionDir)include\libzip\lib\bz2.lib;dbghelp.lib;Wldap32.lib;Normaliz.lib;version.lib;%(AdditionalDependencies) %(AdditionalLibraryDirectories) @@ -453,7 +453,7 @@ - + From 9d3422ddae071f22328756eb329a78374c4b1357 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 3 Jan 2023 03:27:29 +0100 Subject: [PATCH 45/78] fix: abort mod install if hashes do NOT match --- NorthstarDLL/verifiedmods.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 06ff810a7..1da827332 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -321,12 +321,12 @@ void DownloadMod(char* modName, char* modVersion) } // Verify checksum of downloaded archive. - if (check_mod_archive_checksum(downloadPath, modChecksum)) + if (!check_mod_archive_checksum(downloadPath, modChecksum)) { spdlog::error("Archive checksum does not match verified hash."); goto REQUEST_END_CLEANUP; } - spdlog::error("Checksum OK!"); + spdlog::info("Checksum OK!"); // Unzip mods from downloaded archive. zip = zip_open(downloadPath.generic_string().c_str(), ZIP_RDONLY, &err); From 9f0f2a80430b298109c847e6f9c71025c4d6fb8a Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 3 Jan 2023 15:12:32 +0100 Subject: [PATCH 46/78] docs: add some documentation --- NorthstarDLL/verifiedmods.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 1da827332..434dfc3c2 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -186,7 +186,10 @@ int get_mod_archive_content_size(zip_t* zip) } /** - * sha256 code shamelessly stolen from https://stackoverflow.com/a/74671723/11243782 + * Computes the hash of the archive located at `path`, and compares it + * with `expectedHash`: this will return true if the two are equal, + * false otherwise. + * SHA256 code shamelessly stolen from https://stackoverflow.com/a/74671723/11243782 **/ bool check_mod_archive_checksum(std::filesystem::path path, std::string expectedHash) { @@ -430,6 +433,8 @@ void DownloadMod(char* modName, char* modVersion) spdlog::info("Mod successfully extracted."); + // Called at the end of the thread, regardless if mod download and extraction went + // successfully or not. REQUEST_END_CLEANUP: fclose(fp); modsBeingDownloaded.erase(std::remove(std::begin(modsBeingDownloaded), std::end(modsBeingDownloaded), modName)); From 56883fef6876b9dacee5ef19eaceca6d1de2410f Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 3 Jan 2023 15:37:29 +0100 Subject: [PATCH 47/78] feat: abort mod download on create_directory failure --- NorthstarDLL/verifiedmods.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 434dfc3c2..cb01db727 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -285,6 +285,7 @@ void DownloadMod(char* modName, char* modVersion) int err = 0; zip_t* zip; struct zip_stat sb; + std::error_code ec; int totalSize = 0; int extractedSize = 0; @@ -392,8 +393,12 @@ void DownloadMod(char* modName, char* modVersion) if (modName.back() == '/') { - // TODO catch errors - std::filesystem::create_directory(destination); + if (!std::filesystem::create_directory(destination, ec)) + { + spdlog::error("Directory creation failed: {}", zip_strerror(zip)); + // TODO check ec for custom error message + goto REQUEST_END_CLEANUP; + } } else { From 118dc53defd041be7b56ec7acdfdf283286744ed Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 3 Jan 2023 16:26:57 +0100 Subject: [PATCH 48/78] feat: abort mod extraction if input stream is not open --- NorthstarDLL/verifiedmods.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index cb01db727..1191d9e32 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -407,7 +407,11 @@ void DownloadMod(char* modName, char* modVersion) struct zip_file* zf = zip_fopen_index(zip, i, 0); std::ofstream writeStream(destination, std::ofstream::binary); - // TODO return if stream is not open + if (!writeStream.is_open()) + { + spdlog::error("Failed writing file to disk."); + goto REQUEST_END_CLEANUP; + } int sum = 0; int len = 0; From 38f38ac01e3ea1180d13ecfeb305f352ae80f708 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 3 Jan 2023 16:36:29 +0100 Subject: [PATCH 49/78] feat: add link to error_code values --- NorthstarDLL/verifiedmods.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 1191d9e32..ac6fe4297 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -396,7 +396,7 @@ void DownloadMod(char* modName, char* modVersion) if (!std::filesystem::create_directory(destination, ec)) { spdlog::error("Directory creation failed: {}", zip_strerror(zip)); - // TODO check ec for custom error message + // TODO check ec for custom error message (values: https://en.cppreference.com/w/cpp/error/errc) goto REQUEST_END_CLEANUP; } } From 6966f794bb4f686414e4cdcd82d02b0edf845dc6 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 8 Jan 2023 18:19:23 +0100 Subject: [PATCH 50/78] build: move verified stuff into mods/verified/ filter --- NorthstarDLL/NorthstarDLL.vcxproj.filters | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters index 0d920a445..73a946e30 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj.filters +++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters @@ -181,6 +181,9 @@ {1a377c09-bd3d-4757-b3bc-9cd0a1e6ac0d} + + {d14c40a3-f54b-41f6-acca-3ecc4b83cc38} + @@ -1429,9 +1432,6 @@ Source Files\scripts - - Source Files\scripts\client - Source Files\core @@ -1441,10 +1441,13 @@ Source Files\util + + Source Files\mods\verified + Source Files - + \ No newline at end of file From 5d057855529d59be32900b0a00c876e4378e90ab Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 8 Jan 2023 18:32:50 +0100 Subject: [PATCH 51/78] feat: add VerificationResult enum --- NorthstarDLL/verification_result.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 NorthstarDLL/verification_result.cpp diff --git a/NorthstarDLL/verification_result.cpp b/NorthstarDLL/verification_result.cpp new file mode 100644 index 000000000..5815d595a --- /dev/null +++ b/NorthstarDLL/verification_result.cpp @@ -0,0 +1,16 @@ +#pragma once + +/** + * This enumeration allows to characterize result of verified mod downloading and extraction. + * Its values match localization entries client-side, which will be displayed by Squirrel VM + * to users if operation result is different than OK. + **/ +enum VerificationResult +{ + OK, + FAILED, // Generic error message, should be avoided as much as possible + FAILED_WRITING_TO_DISK, + MOD_FETCHING_FAILED, + MOD_CORRUPTED, // Downloaded archive checksum does not match verified hash + NO_DISK_SPACE_AVAILABLE, +}; From e24a51ed82daa5bb8031b54aa0cdd867e6a3175e Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 8 Jan 2023 18:40:56 +0100 Subject: [PATCH 52/78] feat: add FAILED_READING_ARCHIVE value to result enum --- NorthstarDLL/verification_result.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/NorthstarDLL/verification_result.cpp b/NorthstarDLL/verification_result.cpp index 5815d595a..3228c35b5 100644 --- a/NorthstarDLL/verification_result.cpp +++ b/NorthstarDLL/verification_result.cpp @@ -9,6 +9,7 @@ enum VerificationResult { OK, FAILED, // Generic error message, should be avoided as much as possible + FAILED_READING_ARCHIVE, FAILED_WRITING_TO_DISK, MOD_FETCHING_FAILED, MOD_CORRUPTED, // Downloaded archive checksum does not match verified hash From d969edd572fe195cf80d9d93005e6be21c0f514d Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 8 Jan 2023 18:43:35 +0100 Subject: [PATCH 53/78] feat: add a modDownloadAndExtractionResult variable to track process result --- NorthstarDLL/verifiedmods.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index ac6fe4297..6bb0da945 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -10,6 +10,7 @@ #include "config/profile.h" #include "openssl/evp.h" #include "openssl/sha.h" +#include using namespace rapidjson; @@ -28,6 +29,9 @@ Document verifiedModsJson; // This list holds the names of all mods that are currently being downloaded. std::vector modsBeingDownloaded {}; +// This holds result of mod downloading and extraction. +VerificationResult modDownloadAndExtractionResult; + // This vector holds information about the currently downloaded mod: // 1. received quantity // 2. total quantity expected @@ -274,6 +278,7 @@ void DownloadMod(char* modName, char* modVersion) if (modChecksum.empty()) { spdlog::error("Failed to load expected archive checksum."); + modDownloadAndExtractionResult = FAILED; return; } @@ -321,6 +326,7 @@ void DownloadMod(char* modName, char* modVersion) else { spdlog::info("Fetching mod failed: {}", curl_easy_strerror(result)); + modDownloadAndExtractionResult = MOD_FETCHING_FAILED; goto REQUEST_END_CLEANUP; } @@ -328,6 +334,7 @@ void DownloadMod(char* modName, char* modVersion) if (!check_mod_archive_checksum(downloadPath, modChecksum)) { spdlog::error("Archive checksum does not match verified hash."); + modDownloadAndExtractionResult = MOD_CORRUPTED; goto REQUEST_END_CLEANUP; } spdlog::info("Checksum OK!"); @@ -338,6 +345,7 @@ void DownloadMod(char* modName, char* modVersion) if (err != ZIP_ER_OK) { spdlog::error("Opening mod archive failed: {}", zip_strerror(zip)); + modDownloadAndExtractionResult = FAILED; goto REQUEST_END_CLEANUP; } @@ -370,6 +378,7 @@ void DownloadMod(char* modName, char* modVersion) if (name == nullptr) { spdlog::error("Failed reading archive."); + modDownloadAndExtractionResult = FAILED_READING_ARCHIVE; goto REQUEST_END_CLEANUP; } @@ -397,6 +406,7 @@ void DownloadMod(char* modName, char* modVersion) { spdlog::error("Directory creation failed: {}", zip_strerror(zip)); // TODO check ec for custom error message (values: https://en.cppreference.com/w/cpp/error/errc) + modDownloadAndExtractionResult = FAILED_WRITING_TO_DISK; goto REQUEST_END_CLEANUP; } } @@ -410,6 +420,7 @@ void DownloadMod(char* modName, char* modVersion) if (!writeStream.is_open()) { spdlog::error("Failed writing file to disk."); + modDownloadAndExtractionResult = FAILED_WRITING_TO_DISK; goto REQUEST_END_CLEANUP; } @@ -441,6 +452,7 @@ void DownloadMod(char* modName, char* modVersion) } spdlog::info("Mod successfully extracted."); + modDownloadAndExtractionResult = OK; // Called at the end of the thread, regardless if mod download and extraction went // successfully or not. From 95e712fd05de403d210c6b024add19208903c12c Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 8 Jan 2023 18:54:12 +0100 Subject: [PATCH 54/78] fix: add missing header --- NorthstarDLL/verification_result.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NorthstarDLL/verification_result.cpp b/NorthstarDLL/verification_result.cpp index 3228c35b5..66a054182 100644 --- a/NorthstarDLL/verification_result.cpp +++ b/NorthstarDLL/verification_result.cpp @@ -1,4 +1,4 @@ -#pragma once +#include "pch.h" /** * This enumeration allows to characterize result of verified mod downloading and extraction. From 74b8722458d91a9b0d71d644f423d7f05b26279c Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 8 Jan 2023 18:55:06 +0100 Subject: [PATCH 55/78] build: include enum file in compilation process --- NorthstarDLL/NorthstarDLL.vcxproj | 1 + NorthstarDLL/NorthstarDLL.vcxproj.filters | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj index fe89e8356..a1645965a 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj +++ b/NorthstarDLL/NorthstarDLL.vcxproj @@ -510,6 +510,7 @@ Create Create + diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters index 73a946e30..415f9f65c 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj.filters +++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters @@ -1444,6 +1444,9 @@ Source Files\mods\verified + + Source Files\mods\verified + From 43006e6fce37ff2c44708cc0f4f9dea95a79cd00 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 8 Jan 2023 21:44:29 +0100 Subject: [PATCH 56/78] fix: add header file for verification results --- NorthstarDLL/NorthstarDLL.vcxproj | 3 ++- NorthstarDLL/NorthstarDLL.vcxproj.filters | 8 +++++++- NorthstarDLL/verification_results.cpp | 10 ++++++++++ ...{verification_result.cpp => verification_results.h} | 8 ++++---- 4 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 NorthstarDLL/verification_results.cpp rename NorthstarDLL/{verification_result.cpp => verification_results.h} (64%) diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj index a1645965a..2117accba 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj +++ b/NorthstarDLL/NorthstarDLL.vcxproj @@ -454,6 +454,7 @@ + @@ -510,7 +511,7 @@ Create Create - + diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters index 415f9f65c..ea217b4f0 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj.filters +++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters @@ -184,6 +184,9 @@ {d14c40a3-f54b-41f6-acca-3ecc4b83cc38} + + {8b2cefce-037f-4c76-af2d-bbbd85588e3b} + @@ -1197,6 +1200,9 @@ Header Files\util + + Header Files\mods\verified + @@ -1444,7 +1450,7 @@ Source Files\mods\verified - + Source Files\mods\verified diff --git a/NorthstarDLL/verification_results.cpp b/NorthstarDLL/verification_results.cpp new file mode 100644 index 000000000..0c55b9e1f --- /dev/null +++ b/NorthstarDLL/verification_results.cpp @@ -0,0 +1,10 @@ +#include "pch.h" +#include +#include + +std::array _resultValues { + "OK", "FAILED", "FAILED_READING_ARCHIVE", "FAILED_WRITING_TO_DISK", "MOD_FETCHING_FAILED", "MOD_CORRUPTED", "NO_DISK_SPACE_AVAILABLE"}; + +const char* GetVerifiedModErrorString( VerificationResult error ) { + return _resultValues[error].c_str(); +} diff --git a/NorthstarDLL/verification_result.cpp b/NorthstarDLL/verification_results.h similarity index 64% rename from NorthstarDLL/verification_result.cpp rename to NorthstarDLL/verification_results.h index 66a054182..f6d688011 100644 --- a/NorthstarDLL/verification_result.cpp +++ b/NorthstarDLL/verification_results.h @@ -1,5 +1,3 @@ -#include "pch.h" - /** * This enumeration allows to characterize result of verified mod downloading and extraction. * Its values match localization entries client-side, which will be displayed by Squirrel VM @@ -8,10 +6,12 @@ enum VerificationResult { OK, - FAILED, // Generic error message, should be avoided as much as possible + FAILED, // Generic error message, should be avoided as much as possible FAILED_READING_ARCHIVE, FAILED_WRITING_TO_DISK, MOD_FETCHING_FAILED, - MOD_CORRUPTED, // Downloaded archive checksum does not match verified hash + MOD_CORRUPTED, // Downloaded archive checksum does not match verified hash NO_DISK_SPACE_AVAILABLE, }; + +const char* GetVerifiedModErrorString(VerificationResult error); From 5a3bab1b49591d4c3c5c0c23273880174c64707b Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sun, 8 Jan 2023 21:56:45 +0100 Subject: [PATCH 57/78] feat: add NSGetModExtractionResult Squirrel-exposed method --- NorthstarDLL/verifiedmods.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 6bb0da945..8f0b13038 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -10,7 +10,7 @@ #include "config/profile.h" #include "openssl/evp.h" #include "openssl/sha.h" -#include +#include using namespace rapidjson; @@ -508,6 +508,12 @@ ADD_SQFUNC("bool", NSIsModBeingDownloaded, "string modName", "", ScriptContext:: return SQRESULT_NOTNULL; } +ADD_SQFUNC("string", NSGetModExtractionResult, "", "", ScriptContext::UI) +{ + g_pSquirrel->pushstring(sqvm, GetVerifiedModErrorString(modDownloadAndExtractionResult)); + return SQRESULT_NOTNULL; +} + ADD_SQFUNC("array", NSGetCurrentDownloadProgress, "", "", ScriptContext::UI) { g_pSquirrel->newarray(sqvm, 0); From 4e6d420b60255e024e3d2610c274d89fcf40840b Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Mon, 9 Jan 2023 02:18:56 +0100 Subject: [PATCH 58/78] feat: check errors on directory creation --- NorthstarDLL/verifiedmods.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 8f0b13038..a95ca33a1 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -405,8 +405,7 @@ void DownloadMod(char* modName, char* modVersion) if (!std::filesystem::create_directory(destination, ec)) { spdlog::error("Directory creation failed: {}", zip_strerror(zip)); - // TODO check ec for custom error message (values: https://en.cppreference.com/w/cpp/error/errc) - modDownloadAndExtractionResult = FAILED_WRITING_TO_DISK; + modDownloadAndExtractionResult = ec.value() == ENOSPC ? NO_DISK_SPACE_AVAILABLE : FAILED_WRITING_TO_DISK; goto REQUEST_END_CLEANUP; } } From 71378e3336a5eb73db922e3bc05e02016d79b41c Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Mon, 9 Jan 2023 11:58:06 +0100 Subject: [PATCH 59/78] feat: remove downloaded archive on thread death --- NorthstarDLL/verifiedmods.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index a95ca33a1..edcabad79 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -288,7 +288,7 @@ void DownloadMod(char* modName, char* modVersion) // zip parsing variables zip_int64_t num_entries; int err = 0; - zip_t* zip; + zip_t* zip = NULL; struct zip_stat sb; std::error_code ec; int totalSize = 0; @@ -457,9 +457,16 @@ void DownloadMod(char* modName, char* modVersion) // successfully or not. REQUEST_END_CLEANUP: fclose(fp); + zip_close(zip); + try + { + remove(downloadPath); + } + catch (const std::exception& a) + { + spdlog::error("Error while removing downloaded archive: {}", a.what()); + } modsBeingDownloaded.erase(std::remove(std::begin(modsBeingDownloaded), std::end(modsBeingDownloaded), modName)); - // TODO close zip - // TODO remove temporary folder }); requestThread.detach(); } From b4bcbc5227833fc34db4e51d1660feaa0b2a0356 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Mon, 9 Jan 2023 12:03:01 +0100 Subject: [PATCH 60/78] fix: close zip files after extraction --- NorthstarDLL/verifiedmods.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index edcabad79..20161a955 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -420,6 +420,7 @@ void DownloadMod(char* modName, char* modVersion) { spdlog::error("Failed writing file to disk."); modDownloadAndExtractionResult = FAILED_WRITING_TO_DISK; + zip_fclose(zf); goto REQUEST_END_CLEANUP; } @@ -442,6 +443,7 @@ void DownloadMod(char* modName, char* modVersion) currentDownloadStats[2] = roundf(static_cast(extractedSize) / totalSize * 100); } writeStream.close(); + zip_fclose(zf); } // Sets first statistics field to the count of extracted files, and update From 9b6dda130dcf1654e894c6e691e833c576ced197 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Mon, 9 Jan 2023 12:06:35 +0100 Subject: [PATCH 61/78] style: format --- NorthstarDLL/verification_results.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verification_results.cpp b/NorthstarDLL/verification_results.cpp index 0c55b9e1f..ff86bfae2 100644 --- a/NorthstarDLL/verification_results.cpp +++ b/NorthstarDLL/verification_results.cpp @@ -5,6 +5,7 @@ std::array _resultValues { "OK", "FAILED", "FAILED_READING_ARCHIVE", "FAILED_WRITING_TO_DISK", "MOD_FETCHING_FAILED", "MOD_CORRUPTED", "NO_DISK_SPACE_AVAILABLE"}; -const char* GetVerifiedModErrorString( VerificationResult error ) { +const char* GetVerifiedModErrorString(VerificationResult error) +{ return _resultValues[error].c_str(); } From f68036d4a1292f84eefae3f6113840eb4586576c Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Tue, 10 Jan 2023 02:09:22 +0100 Subject: [PATCH 62/78] feat: put Thunderstore manifest.json file into mods directories --- NorthstarDLL/verifiedmods.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 20161a955..80fe151be 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -293,6 +293,7 @@ void DownloadMod(char* modName, char* modVersion) std::error_code ec; int totalSize = 0; int extractedSize = 0; + std::filesystem::path manifestPath = std::filesystem::path(GetNorthstarPrefix()) / "manifest.json"; // loading game path std::string archiveName = (std::string)dependencyString + ".zip"; @@ -392,7 +393,7 @@ void DownloadMod(char* modName, char* modVersion) // A well-formatted Thunderstore archive contains files such as icon.png, // manifest.json and README.md; we don't want to extract those, but only // the content of the mods/ directory. - if (strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") + if ((strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") && strcmp(name, "manifest.json") != 0) { continue; } @@ -402,12 +403,19 @@ void DownloadMod(char* modName, char* modVersion) if (modName.back() == '/') { + // Create directory if (!std::filesystem::create_directory(destination, ec)) { spdlog::error("Directory creation failed: {}", zip_strerror(zip)); modDownloadAndExtractionResult = ec.value() == ENOSPC ? NO_DISK_SPACE_AVAILABLE : FAILED_WRITING_TO_DISK; goto REQUEST_END_CLEANUP; } + + // Extracting manifest.json to mods root directory + if (std::count(modName.begin(), modName.end(), '/') == 2) + { + std::filesystem::copy(manifestPath, destination / "manifest.json"); + } } else { @@ -468,6 +476,10 @@ void DownloadMod(char* modName, char* modVersion) { spdlog::error("Error while removing downloaded archive: {}", a.what()); } + if (exists(manifestPath)) + { + remove(manifestPath); + } modsBeingDownloaded.erase(std::remove(std::begin(modsBeingDownloaded), std::end(modsBeingDownloaded), modName)); }); requestThread.detach(); From a3d304997013182533ffff17d6afea74bc6fad88 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Wed, 18 Jan 2023 00:22:25 +0100 Subject: [PATCH 63/78] feat: add key to mod.json files --- NorthstarDLL/verifiedmods.cpp | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 80fe151be..007a40fc3 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -11,6 +11,9 @@ #include "openssl/evp.h" #include "openssl/sha.h" #include +#include +#include +#include using namespace rapidjson; @@ -127,6 +130,45 @@ bool IsModVerified(char* modName, char* modVersion) return false; } +/** + * Adds a `"AutoDownloaded": true` entry into json file located at `filepath`. + **/ +bool MarkModJson(std::filesystem::path filepath) +{ + spdlog::info("Add autodownload key to {}", filepath.generic_string()); + using namespace rapidjson; + + std::ifstream ifs {filepath.generic_string().c_str()}; + if (!ifs.is_open()) + { + spdlog::error("Could not open manifest file for reading."); + return false; + } + IStreamWrapper isw {ifs}; + Document doc {}; + doc.ParseStream(isw); + + if (doc.HasParseError()) + { + spdlog::error("Manifest file is not formatted correctly."); + return false; + } + + doc.AddMember("AutoDownloaded", true, doc.GetAllocator()); + + std::ofstream ofs {filepath.generic_string().c_str()}; + if (!ofs.is_open()) + { + spdlog::error("Could not open manifest file for writing."); + return false; + } + OStreamWrapper osw {ofs}; + Writer writer {osw}; + doc.Accept(writer); + + return true; +} + /** * Tells if a mod is currently being downloaded by checking if its name is included * in the `modsBeingDownloaded` variable. @@ -452,6 +494,18 @@ void DownloadMod(char* modName, char* modVersion) } writeStream.close(); zip_fclose(zf); + + // If extracted file is a mod manifest (mod top-level JSON file), we add an + // entry to it, to mark it as "auto-downloaded". + int modNameLength = modName.length(); + if (std::count(modName.begin(), modName.end(), '/') == 2 && + strcmp(modName.substr(modNameLength - 8, modNameLength).c_str(), "mod.json") == 0) + { + if (!MarkModJson(destination)) + { + spdlog::error("Failed to mark mod manifest"); + } + } } // Sets first statistics field to the count of extracted files, and update From 53b4fef6f53652326bf2d2d2e68449b933ba2949 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Wed, 18 Jan 2023 09:07:28 +0100 Subject: [PATCH 64/78] fix: pretty format mod.json files --- NorthstarDLL/verifiedmods.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index 007a40fc3..fee686f64 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -14,6 +14,7 @@ #include #include #include +#include using namespace rapidjson; @@ -163,7 +164,7 @@ bool MarkModJson(std::filesystem::path filepath) return false; } OStreamWrapper osw {ofs}; - Writer writer {osw}; + PrettyWriter writer(osw); doc.Accept(writer); return true; From 363d32388472a3a30a5aee827601e5844465fa2b Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Tue, 24 Jan 2023 17:44:54 +0100 Subject: [PATCH 65/78] feat: fetch verified mods list on DLL load --- NorthstarDLL/verifiedmods.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index fee686f64..a31500202 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -609,3 +609,8 @@ ADD_SQFUNC("void", NSDownloadMod, "string modName, string modVersion", "", Scrip DownloadMod((char*)modName, (char*)modVersion); return SQRESULT_NULL; } + +ON_DLL_LOAD_CLIENT("client.dll", VerifiedMods, (CModule module)) +{ + FetchVerifiedModsList(); +} From 50c2f29b1297371decce1963b183fc7d9b8a04c1 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Tue, 24 Jan 2023 17:50:19 +0100 Subject: [PATCH 66/78] refactor: remove NSFetchVerifiedModsList Squirrel method Since FetchVerifiedModsList is invoked on DLL load (on clients), we don't need to expose it to Squirrel code anymore. --- NorthstarDLL/verifiedmods.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/verifiedmods.cpp index a31500202..29d78bd1e 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/verifiedmods.cpp @@ -556,12 +556,6 @@ void DownloadMod(char* modName, char* modVersion) ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ */ -ADD_SQFUNC("string", NSFetchVerifiedModsList, "", "", ScriptContext::UI) -{ - FetchVerifiedModsList(); - return SQRESULT_NULL; -} - ADD_SQFUNC("bool", NSIsModVerified, "string modName, string modVersion", "", ScriptContext::UI) { const SQChar* modName = g_pSquirrel->getstring(sqvm, 1); From 2041b94c80e406d110c6661486425f1bfdf18db5 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Wed, 25 Jan 2023 08:23:49 +0100 Subject: [PATCH 67/78] refactor: put all verification-related code in a dedicated package --- NorthstarDLL/NorthstarDLL.vcxproj | 8 ++++---- NorthstarDLL/NorthstarDLL.vcxproj.filters | 12 ++++++------ .../{ => mods/verified}/verification_results.cpp | 2 +- .../{ => mods/verified}/verification_results.h | 0 NorthstarDLL/{ => mods/verified}/verifiedmods.cpp | 2 +- NorthstarDLL/{ => mods/verified}/verifiedmods.h | 0 6 files changed, 12 insertions(+), 12 deletions(-) rename NorthstarDLL/{ => mods/verified}/verification_results.cpp (90%) rename NorthstarDLL/{ => mods/verified}/verification_results.h (100%) rename NorthstarDLL/{ => mods/verified}/verifiedmods.cpp (99%) rename NorthstarDLL/{ => mods/verified}/verifiedmods.h (100%) diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj index 2117accba..870a94419 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj +++ b/NorthstarDLL/NorthstarDLL.vcxproj @@ -434,6 +434,8 @@ + + @@ -454,8 +456,6 @@ - - @@ -507,12 +507,12 @@ + + Create Create - - diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters index ea217b4f0..163ff136c 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj.filters +++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters @@ -1071,9 +1071,6 @@ Header Files - - Header Files - Header Files @@ -1200,7 +1197,10 @@ Header Files\util - + + Header Files\mods\verified + + Header Files\mods\verified @@ -1447,10 +1447,10 @@ Source Files\util - + Source Files\mods\verified - + Source Files\mods\verified diff --git a/NorthstarDLL/verification_results.cpp b/NorthstarDLL/mods/verified/verification_results.cpp similarity index 90% rename from NorthstarDLL/verification_results.cpp rename to NorthstarDLL/mods/verified/verification_results.cpp index ff86bfae2..8a07199e3 100644 --- a/NorthstarDLL/verification_results.cpp +++ b/NorthstarDLL/mods/verified/verification_results.cpp @@ -1,6 +1,6 @@ #include "pch.h" #include -#include +#include "verification_results.h" std::array _resultValues { "OK", "FAILED", "FAILED_READING_ARCHIVE", "FAILED_WRITING_TO_DISK", "MOD_FETCHING_FAILED", "MOD_CORRUPTED", "NO_DISK_SPACE_AVAILABLE"}; diff --git a/NorthstarDLL/verification_results.h b/NorthstarDLL/mods/verified/verification_results.h similarity index 100% rename from NorthstarDLL/verification_results.h rename to NorthstarDLL/mods/verified/verification_results.h diff --git a/NorthstarDLL/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp similarity index 99% rename from NorthstarDLL/verifiedmods.cpp rename to NorthstarDLL/mods/verified/verifiedmods.cpp index 29d78bd1e..6f5913851 100644 --- a/NorthstarDLL/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -10,7 +10,7 @@ #include "config/profile.h" #include "openssl/evp.h" #include "openssl/sha.h" -#include +#include "verification_results.h" #include #include #include diff --git a/NorthstarDLL/verifiedmods.h b/NorthstarDLL/mods/verified/verifiedmods.h similarity index 100% rename from NorthstarDLL/verifiedmods.h rename to NorthstarDLL/mods/verified/verifiedmods.h From d51260a3136d38f64ad16865f2fe21ba3b85b343 Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Wed, 25 Jan 2023 08:32:13 +0100 Subject: [PATCH 68/78] refactor: remove unused verifiedmods.h file --- NorthstarDLL/NorthstarDLL.vcxproj | 1 - NorthstarDLL/NorthstarDLL.vcxproj.filters | 3 --- NorthstarDLL/mods/verified/verifiedmods.cpp | 1 - NorthstarDLL/mods/verified/verifiedmods.h | 4 ---- 4 files changed, 9 deletions(-) delete mode 100644 NorthstarDLL/mods/verified/verifiedmods.h diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj index 870a94419..59dc7e204 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj +++ b/NorthstarDLL/NorthstarDLL.vcxproj @@ -435,7 +435,6 @@ - diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters index 163ff136c..0fcb5e0ec 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj.filters +++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters @@ -1200,9 +1200,6 @@ Header Files\mods\verified - - Header Files\mods\verified - diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index 6f5913851..453395df9 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -4,7 +4,6 @@ #include "rapidjson/writer.h" #include "rapidjson/stringbuffer.h" #include "squirrel/squirrel.h" -#include "verifiedmods.h" #include "libzip/include/zip.h" #include #include "config/profile.h" diff --git a/NorthstarDLL/mods/verified/verifiedmods.h b/NorthstarDLL/mods/verified/verifiedmods.h deleted file mode 100644 index baacb496f..000000000 --- a/NorthstarDLL/mods/verified/verifiedmods.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include "core/memalloc.h" - -void InitialiseVerifiedModsScripts(HMODULE baseAddress); From 1249fd20cec9a52d13b7538f353755da42b59b21 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Wed, 25 Jan 2023 19:24:18 +0100 Subject: [PATCH 69/78] refactor: move util methods to dedicated files --- NorthstarDLL/NorthstarDLL.vcxproj | 2 + NorthstarDLL/NorthstarDLL.vcxproj.filters | 6 + NorthstarDLL/mods/verified/verifiedmods.cpp | 139 +----------------- .../mods/verified/verifiedmodsutils.cpp | 119 +++++++++++++++ .../mods/verified/verifiedmodsutils.h | 26 ++++ 5 files changed, 159 insertions(+), 133 deletions(-) create mode 100644 NorthstarDLL/mods/verified/verifiedmodsutils.cpp create mode 100644 NorthstarDLL/mods/verified/verifiedmodsutils.h diff --git a/NorthstarDLL/NorthstarDLL.vcxproj b/NorthstarDLL/NorthstarDLL.vcxproj index 59dc7e204..ca90bb089 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj +++ b/NorthstarDLL/NorthstarDLL.vcxproj @@ -435,6 +435,7 @@ + @@ -508,6 +509,7 @@ + Create Create diff --git a/NorthstarDLL/NorthstarDLL.vcxproj.filters b/NorthstarDLL/NorthstarDLL.vcxproj.filters index 0fcb5e0ec..a2f7dbca7 100644 --- a/NorthstarDLL/NorthstarDLL.vcxproj.filters +++ b/NorthstarDLL/NorthstarDLL.vcxproj.filters @@ -1200,6 +1200,9 @@ Header Files\mods\verified + + Header Files\mods\verified + @@ -1450,6 +1453,9 @@ Source Files\mods\verified + + Source Files\mods\verified + diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index 453395df9..b9eb8fa98 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -5,15 +5,15 @@ #include "rapidjson/stringbuffer.h" #include "squirrel/squirrel.h" #include "libzip/include/zip.h" -#include #include "config/profile.h" -#include "openssl/evp.h" -#include "openssl/sha.h" #include "verification_results.h" +#include "verifiedmodsutils.h" +#include +#include +#include "openssl/evp.h" +#include #include -#include -#include -#include +#include using namespace rapidjson; @@ -130,45 +130,6 @@ bool IsModVerified(char* modName, char* modVersion) return false; } -/** - * Adds a `"AutoDownloaded": true` entry into json file located at `filepath`. - **/ -bool MarkModJson(std::filesystem::path filepath) -{ - spdlog::info("Add autodownload key to {}", filepath.generic_string()); - using namespace rapidjson; - - std::ifstream ifs {filepath.generic_string().c_str()}; - if (!ifs.is_open()) - { - spdlog::error("Could not open manifest file for reading."); - return false; - } - IStreamWrapper isw {ifs}; - Document doc {}; - doc.ParseStream(isw); - - if (doc.HasParseError()) - { - spdlog::error("Manifest file is not formatted correctly."); - return false; - } - - doc.AddMember("AutoDownloaded", true, doc.GetAllocator()); - - std::ofstream ofs {filepath.generic_string().c_str()}; - if (!ofs.is_open()) - { - spdlog::error("Could not open manifest file for writing."); - return false; - } - OStreamWrapper osw {ofs}; - PrettyWriter writer(osw); - doc.Accept(writer); - - return true; -} - /** * Tells if a mod is currently being downloaded by checking if its name is included * in the `modsBeingDownloaded` variable. @@ -178,16 +139,6 @@ bool IsModBeingDownloaded(char* modName) return std::find(modsBeingDownloaded.begin(), modsBeingDownloaded.end(), modName) != modsBeingDownloaded.end(); } -/** - * cURL method to write data to disk. - **/ -size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) -{ - size_t written; - written = fwrite(ptr, size, nmemb, stream); - return written; -} - /** * cURL method to follow download progression. **/ @@ -205,84 +156,6 @@ int progress_callback( return 0; } -/** - * Returns uncompressed size of all mod files from a Thunderstore archive. - * This excludes all Thunderstore-related files. - **/ -int get_mod_archive_content_size(zip_t* zip) -{ - int totalSize = 0; - int num_entries = zip_get_num_entries(zip, 0); - - for (zip_uint64_t i = 0; i < num_entries; ++i) - { - const char* name = zip_get_name(zip, i, 0); - std::string modName = name; - if (modName.back() == '/' || strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") - { - continue; - } - - struct zip_stat sb; - zip_stat_index(zip, i, 0, &sb); - totalSize += sb.size; - } - - return totalSize; -} - -/** - * Computes the hash of the archive located at `path`, and compares it - * with `expectedHash`: this will return true if the two are equal, - * false otherwise. - * SHA256 code shamelessly stolen from https://stackoverflow.com/a/74671723/11243782 - **/ -bool check_mod_archive_checksum(std::filesystem::path path, std::string expectedHash) -{ - auto sha256 = [](std::string fname, std::vector& hash) -> bool - { - std::unique_ptr evpCtx(EVP_MD_CTX_new(), EVP_MD_CTX_free); - EVP_DigestInit_ex(evpCtx.get(), EVP_sha256(), nullptr); - - constexpr size_t buffer_size {1 << 12}; - std::vector buffer(buffer_size, '\0'); - - std::ifstream fp(fname, std::ios::binary); - if (!fp.is_open()) - { - spdlog::error("Unable to open {}.", fname); - return false; - } - while (fp.good()) - { - fp.read(buffer.data(), buffer_size); - EVP_DigestUpdate(evpCtx.get(), buffer.data(), fp.gcount()); - } - fp.close(); - - hash.resize(SHA256_DIGEST_LENGTH); - std::fill(hash.begin(), hash.end(), 0); - unsigned int len; - EVP_DigestFinal_ex(evpCtx.get(), hash.data(), &len); - - return true; - }; - - // Compute hash of downloaded archive. - std::vector hash; - if (!sha256(path.generic_string(), hash)) - { - return false; - } - std::stringstream out; - for (size_t i = 0; i < hash.size(); i++) - out << std::setfill('0') << std::setw(2) << std::hex << int(hash[i]); - std::string archiveHash = out.str(); - - // Compare computed hash with expected hash. - return strcmp(archiveHash.c_str(), expectedHash.c_str()) == 0; -} - /** * Downloads a given mod from Thunderstore API to local game folder. * This is done following these steps: diff --git a/NorthstarDLL/mods/verified/verifiedmodsutils.cpp b/NorthstarDLL/mods/verified/verifiedmodsutils.cpp new file mode 100644 index 000000000..65333d127 --- /dev/null +++ b/NorthstarDLL/mods/verified/verifiedmodsutils.cpp @@ -0,0 +1,119 @@ +#include "pch.h" +#include +#include +#include +#include +#include +#include +#include + +bool MarkModJson(std::filesystem::path filepath) +{ + spdlog::info("Add autodownload key to {}", filepath.generic_string()); + using namespace rapidjson; + + std::ifstream ifs {filepath.generic_string().c_str()}; + if (!ifs.is_open()) + { + spdlog::error("Could not open manifest file for reading."); + return false; + } + IStreamWrapper isw {ifs}; + Document doc {}; + doc.ParseStream(isw); + + if (doc.HasParseError()) + { + spdlog::error("Manifest file is not formatted correctly."); + return false; + } + + doc.AddMember("AutoDownloaded", true, doc.GetAllocator()); + + std::ofstream ofs {filepath.generic_string().c_str()}; + if (!ofs.is_open()) + { + spdlog::error("Could not open manifest file for writing."); + return false; + } + OStreamWrapper osw {ofs}; + PrettyWriter writer(osw); + doc.Accept(writer); + + return true; +} + +size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) +{ + size_t written; + written = fwrite(ptr, size, nmemb, stream); + return written; +} + +int get_mod_archive_content_size(zip_t* zip) +{ + int totalSize = 0; + int num_entries = zip_get_num_entries(zip, 0); + + for (zip_uint64_t i = 0; i < num_entries; ++i) + { + const char* name = zip_get_name(zip, i, 0); + std::string modName = name; + if (modName.back() == '/' || strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") + { + continue; + } + + struct zip_stat sb; + zip_stat_index(zip, i, 0, &sb); + totalSize += sb.size; + } + + return totalSize; +} + +bool check_mod_archive_checksum(std::filesystem::path path, std::string expectedHash) +{ + auto sha256 = [](std::string fname, std::vector& hash) -> bool + { + std::unique_ptr evpCtx(EVP_MD_CTX_new(), EVP_MD_CTX_free); + EVP_DigestInit_ex(evpCtx.get(), EVP_sha256(), nullptr); + + constexpr size_t buffer_size {1 << 12}; + std::vector buffer(buffer_size, '\0'); + + std::ifstream fp(fname, std::ios::binary); + if (!fp.is_open()) + { + spdlog::error("Unable to open {}.", fname); + return false; + } + while (fp.good()) + { + fp.read(buffer.data(), buffer_size); + EVP_DigestUpdate(evpCtx.get(), buffer.data(), fp.gcount()); + } + fp.close(); + + hash.resize(SHA256_DIGEST_LENGTH); + std::fill(hash.begin(), hash.end(), 0); + unsigned int len; + EVP_DigestFinal_ex(evpCtx.get(), hash.data(), &len); + + return true; + }; + + // Compute hash of downloaded archive. + std::vector hash; + if (!sha256(path.generic_string(), hash)) + { + return false; + } + std::stringstream out; + for (size_t i = 0; i < hash.size(); i++) + out << std::setfill('0') << std::setw(2) << std::hex << int(hash[i]); + std::string archiveHash = out.str(); + + // Compare computed hash with expected hash. + return strcmp(archiveHash.c_str(), expectedHash.c_str()) == 0; +} diff --git a/NorthstarDLL/mods/verified/verifiedmodsutils.h b/NorthstarDLL/mods/verified/verifiedmodsutils.h new file mode 100644 index 000000000..af5515cdc --- /dev/null +++ b/NorthstarDLL/mods/verified/verifiedmodsutils.h @@ -0,0 +1,26 @@ +#include +#include + +/** + * Adds a `"AutoDownloaded": true` entry into json file located at `filepath`. + **/ +bool MarkModJson(std::filesystem::path filepath); + +/** + * cURL method to write data to disk. + **/ +size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream); + +/** + * Returns uncompressed size of all mod files from a Thunderstore archive. + * This excludes all Thunderstore-related files. + **/ +int get_mod_archive_content_size(zip_t* zip); + +/** + * Computes the hash of the archive located at `path`, and compares it + * with `expectedHash`: this will return true if the two are equal, + * false otherwise. + * SHA256 code shamelessly stolen from https://stackoverflow.com/a/74671723/11243782 + **/ +bool check_mod_archive_checksum(std::filesystem::path path, std::string expectedHash); From 93fed07716505e0af14517c1ca31f0df60ed6ab3 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Thu, 26 Jan 2023 01:23:40 +0100 Subject: [PATCH 70/78] feat: create thunderstore_author.txt files --- NorthstarDLL/mods/verified/verifiedmods.cpp | 5 +++++ NorthstarDLL/mods/verified/verifiedmodsutils.cpp | 12 ++++++++++++ NorthstarDLL/mods/verified/verifiedmodsutils.h | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index b9eb8fa98..bbc6ffe50 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -330,6 +330,7 @@ void DownloadMod(char* modName, char* modVersion) if (std::count(modName.begin(), modName.end(), '/') == 2) { std::filesystem::copy(manifestPath, destination / "manifest.json"); + CreateModAuthorFile(dependencyString.substr(0, dependencyString.find('-')), destination / "thunderstore_author.txt"); } } else @@ -370,6 +371,9 @@ void DownloadMod(char* modName, char* modVersion) // If extracted file is a mod manifest (mod top-level JSON file), we add an // entry to it, to mark it as "auto-downloaded". + // (not done anymore, check https://github.com/0neGal/viper/issues/165 for + // information on new format) + /* int modNameLength = modName.length(); if (std::count(modName.begin(), modName.end(), '/') == 2 && strcmp(modName.substr(modNameLength - 8, modNameLength).c_str(), "mod.json") == 0) @@ -379,6 +383,7 @@ void DownloadMod(char* modName, char* modVersion) spdlog::error("Failed to mark mod manifest"); } } + */ } // Sets first statistics field to the count of extracted files, and update diff --git a/NorthstarDLL/mods/verified/verifiedmodsutils.cpp b/NorthstarDLL/mods/verified/verifiedmodsutils.cpp index 65333d127..7b134a830 100644 --- a/NorthstarDLL/mods/verified/verifiedmodsutils.cpp +++ b/NorthstarDLL/mods/verified/verifiedmodsutils.cpp @@ -43,6 +43,18 @@ bool MarkModJson(std::filesystem::path filepath) return true; } +bool CreateModAuthorFile(std::string authorName, std::filesystem::path filepath) { + std::ofstream writeStream(filepath); + if (!writeStream.is_open()) + { + spdlog::error("Failed to open author file."); + return false; + } + writeStream << authorName; + writeStream.close(); + return true; +} + size_t write_data(void* ptr, size_t size, size_t nmemb, FILE* stream) { size_t written; diff --git a/NorthstarDLL/mods/verified/verifiedmodsutils.h b/NorthstarDLL/mods/verified/verifiedmodsutils.h index af5515cdc..b2e7b673e 100644 --- a/NorthstarDLL/mods/verified/verifiedmodsutils.h +++ b/NorthstarDLL/mods/verified/verifiedmodsutils.h @@ -6,6 +6,11 @@ **/ bool MarkModJson(std::filesystem::path filepath); +/** + * Creates a file at `filepath`, and writes `authorName` in it. + **/ +bool CreateModAuthorFile(std::string authorName, std::filesystem::path filepath); + /** * cURL method to write data to disk. **/ From 4933551594fbb30084df734695d1596d366d7095 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Thu, 26 Jan 2023 01:24:10 +0100 Subject: [PATCH 71/78] style: format --- NorthstarDLL/mods/verified/verifiedmods.cpp | 3 ++- NorthstarDLL/mods/verified/verifiedmodsutils.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index bbc6ffe50..0944dd7ae 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -330,7 +330,8 @@ void DownloadMod(char* modName, char* modVersion) if (std::count(modName.begin(), modName.end(), '/') == 2) { std::filesystem::copy(manifestPath, destination / "manifest.json"); - CreateModAuthorFile(dependencyString.substr(0, dependencyString.find('-')), destination / "thunderstore_author.txt"); + CreateModAuthorFile( + dependencyString.substr(0, dependencyString.find('-')), destination / "thunderstore_author.txt"); } } else diff --git a/NorthstarDLL/mods/verified/verifiedmodsutils.cpp b/NorthstarDLL/mods/verified/verifiedmodsutils.cpp index 7b134a830..c41952564 100644 --- a/NorthstarDLL/mods/verified/verifiedmodsutils.cpp +++ b/NorthstarDLL/mods/verified/verifiedmodsutils.cpp @@ -43,7 +43,8 @@ bool MarkModJson(std::filesystem::path filepath) return true; } -bool CreateModAuthorFile(std::string authorName, std::filesystem::path filepath) { +bool CreateModAuthorFile(std::string authorName, std::filesystem::path filepath) +{ std::ofstream writeStream(filepath); if (!writeStream.is_open()) { From 27350a924689aeb38fe0e9f6876b4fbab2ae945d Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Mon, 30 Jan 2023 18:55:37 +0100 Subject: [PATCH 72/78] refactor: unzip mods in remote mods directory --- NorthstarDLL/mods/verified/verifiedmods.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index 0944dd7ae..285158240 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -208,7 +208,7 @@ void DownloadMod(char* modName, char* modVersion) std::error_code ec; int totalSize = 0; int extractedSize = 0; - std::filesystem::path manifestPath = std::filesystem::path(GetNorthstarPrefix()) / "manifest.json"; + std::filesystem::path manifestPath = std::filesystem::path(GetNorthstarPrefix()) / "runtime/remote/manifest.json"; // loading game path std::string archiveName = (std::string)dependencyString + ".zip"; @@ -313,8 +313,11 @@ void DownloadMod(char* modName, char* modVersion) continue; } - spdlog::info(" => {}", name); - std::filesystem::path destination = std::filesystem::path(GetNorthstarPrefix()) / name; + // Install mods in remote mods directory. + modName = "runtime/remote/" + modName; + + spdlog::info(" => {}", modName); + std::filesystem::path destination = std::filesystem::path(GetNorthstarPrefix()) / modName; if (modName.back() == '/') { @@ -327,7 +330,7 @@ void DownloadMod(char* modName, char* modVersion) } // Extracting manifest.json to mods root directory - if (std::count(modName.begin(), modName.end(), '/') == 2) + if (std::count(modName.begin(), modName.end(), '/') == 4) { std::filesystem::copy(manifestPath, destination / "manifest.json"); CreateModAuthorFile( From 0e322ea2371f68a2dad3b0ddb21e673be4b523ef Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 31 Jan 2023 01:17:14 +0100 Subject: [PATCH 73/78] feat: use thunderstore dependency string as mod directory name --- NorthstarDLL/mods/verified/verifiedmods.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index 285158240..1ec5ff0b8 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -208,7 +208,7 @@ void DownloadMod(char* modName, char* modVersion) std::error_code ec; int totalSize = 0; int extractedSize = 0; - std::filesystem::path manifestPath = std::filesystem::path(GetNorthstarPrefix()) / "runtime/remote/manifest.json"; + std::filesystem::path manifestPath = std::filesystem::path(GetNorthstarPrefix()) / "runtime/remote/mods/manifest.json"; // loading game path std::string archiveName = (std::string)dependencyString + ".zip"; @@ -313,8 +313,16 @@ void DownloadMod(char* modName, char* modVersion) continue; } + // Use thunderstore dependency string as mod folder name. + // (example: mods/Bombing Run/mod.json => runtime/remote/mods/Alystrasz-BombingRun-0.0.3/mod.json) + if (strcmp(name, "manifest.json") != 0) + { + std::string fileNameWithoutModName = modName.substr(modName.find("/", 5), modName.length()); + modName = dependencyString + fileNameWithoutModName; + } + // Install mods in remote mods directory. - modName = "runtime/remote/" + modName; + modName = "runtime/remote/mods/" + modName; spdlog::info(" => {}", modName); std::filesystem::path destination = std::filesystem::path(GetNorthstarPrefix()) / modName; From 421b6ceea581f7a506f56da33c521ac57bf468c6 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Tue, 31 Jan 2023 01:31:19 +0100 Subject: [PATCH 74/78] style: typo in variable name --- NorthstarDLL/mods/verified/verifiedmods.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index 1ec5ff0b8..5bfb3dcf9 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -298,7 +298,7 @@ void DownloadMod(char* modName, char* modVersion) goto REQUEST_END_CLEANUP; } - std::string modName = name; + std::string fileName = name; // Only extracting files that belong to mods. // @@ -308,7 +308,7 @@ void DownloadMod(char* modName, char* modVersion) // A well-formatted Thunderstore archive contains files such as icon.png, // manifest.json and README.md; we don't want to extract those, but only // the content of the mods/ directory. - if ((strcmp(name, "mods/") == 0 || modName.substr(0, 5) != "mods/") && strcmp(name, "manifest.json") != 0) + if ((strcmp(name, "mods/") == 0 || fileName.substr(0, 5) != "mods/") && strcmp(name, "manifest.json") != 0) { continue; } @@ -317,17 +317,17 @@ void DownloadMod(char* modName, char* modVersion) // (example: mods/Bombing Run/mod.json => runtime/remote/mods/Alystrasz-BombingRun-0.0.3/mod.json) if (strcmp(name, "manifest.json") != 0) { - std::string fileNameWithoutModName = modName.substr(modName.find("/", 5), modName.length()); - modName = dependencyString + fileNameWithoutModName; + std::string fileNameWithoutModName = fileName.substr(fileName.find("/", 5), fileName.length()); + fileName = dependencyString + fileNameWithoutModName; } // Install mods in remote mods directory. - modName = "runtime/remote/mods/" + modName; + fileName = "runtime/remote/mods/" + fileName; - spdlog::info(" => {}", modName); - std::filesystem::path destination = std::filesystem::path(GetNorthstarPrefix()) / modName; + spdlog::info(" => {}", fileName); + std::filesystem::path destination = std::filesystem::path(GetNorthstarPrefix()) / fileName; - if (modName.back() == '/') + if (fileName.back() == '/') { // Create directory if (!std::filesystem::create_directory(destination, ec)) @@ -338,7 +338,7 @@ void DownloadMod(char* modName, char* modVersion) } // Extracting manifest.json to mods root directory - if (std::count(modName.begin(), modName.end(), '/') == 4) + if (std::count(fileName.begin(), fileName.end(), '/') == 4) { std::filesystem::copy(manifestPath, destination / "manifest.json"); CreateModAuthorFile( From bf9ab566ccec1baa06c28fa81252c142d7692e9a Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sat, 4 Feb 2023 13:44:54 +0100 Subject: [PATCH 75/78] feat: add Dinorush.Brute4 mod to verified mods --- NorthstarDLL/mods/verified/verifiedmods.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index 5bfb3dcf9..c7057113f 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -56,6 +56,12 @@ const char* modsTestString = "{ \"Version\": \"0.0.1\", \"Checksum\": \"8cf111c9ac2ab1521677769702e10be4db8d47c0eca16bda197aceb895cf2b5c\" }" "]}," + "\"Dinorush.Brute4\": {" + "\"DependencyPrefix\": \"Dinorush-DinorushBrute4\"," + "\"Versions\" : [" + "{ \"Version\": \"1.7.2\", \"Checksum\": \"e5b752006e893061fb908c3671a5984093f5f6600da2f861dab30ab5f50f56a2\" }" + "]}," + "\"Zircon Spitfire\": {" "\"DependencyPrefix\": \"Juicys_Emporium-Zircon_Spitfire\"," "\"Versions\" : [" From 9981922e9d1fa94ca171b89b2b8f6e0a642e8e38 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Fri, 26 May 2023 17:10:21 +0200 Subject: [PATCH 76/78] refactor: add s2s map as verified mod --- NorthstarDLL/mods/verified/verifiedmods.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index c7057113f..8677a2eb6 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -50,22 +50,10 @@ std::vector currentDownloadStats(6); // Test string used to test branch without masterserver const char* modsTestString = "{" - "\"Fifty.mp_frostbite\": {" - "\"DependencyPrefix\": \"Fifty-Frostbite\"," + "\"Odd.s2space\": {" + "\"DependencyPrefix\": \"odds-s2space\"," "\"Versions\" : [" - "{ \"Version\": \"0.0.1\", \"Checksum\": \"8cf111c9ac2ab1521677769702e10be4db8d47c0eca16bda197aceb895cf2b5c\" }" - "]}," - - "\"Dinorush.Brute4\": {" - "\"DependencyPrefix\": \"Dinorush-DinorushBrute4\"," - "\"Versions\" : [" - "{ \"Version\": \"1.7.2\", \"Checksum\": \"e5b752006e893061fb908c3671a5984093f5f6600da2f861dab30ab5f50f56a2\" }" - "]}," - - "\"Zircon Spitfire\": {" - "\"DependencyPrefix\": \"Juicys_Emporium-Zircon_Spitfire\"," - "\"Versions\" : [" - "{ \"Version\": \"1.0.0\", \"Checksum\": \"b742d09832a97bdbbd6b9184884712ef4093e3b4ba29eae40b40db26308ba42e\" }" + "{ \"Version\": \"0.0.4\", \"Checksum\": \"4083d0257948766d1c8eaf121395047f5de2c67be49aca937ec43d603b6c1f97\" }" "]}" "}"; From d6e4900e73583ebaea8439bbb89b96c187bc376f Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Fri, 26 May 2023 17:24:16 +0200 Subject: [PATCH 77/78] fix: create files parent directory if needed --- NorthstarDLL/mods/verified/verifiedmods.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index 8677a2eb6..0372d6073 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -321,6 +321,26 @@ void DownloadMod(char* modName, char* modVersion) spdlog::info(" => {}", fileName); std::filesystem::path destination = std::filesystem::path(GetNorthstarPrefix()) / fileName; + + // From time to time, file entries appear before directory containing + // them, so we need to create the latter before extracting the file. + // e.g.: + // * archive.zip/icon.png + // * archive.zip/manifest.json + // * archive.zip/mods/firstMod/mod.json <== firstMod directory is mentioned in mod.json's path... + // * archive.zip/mods/firstMod/ <== ... while it should be created here. + if (!std::filesystem::exists(destination.parent_path())) + { + spdlog::warn("Parent directory does not exist for file {}, creating it.", destination.generic_string()); + if (!std::filesystem::create_directories(destination.parent_path(), ec)) + { + spdlog::error("Parent directory ({}) creation failed.", destination.parent_path().generic_string()); + modDownloadAndExtractionResult = ec.value() == ENOSPC ? NO_DISK_SPACE_AVAILABLE : FAILED_WRITING_TO_DISK; + goto REQUEST_END_CLEANUP; + } + } + + if (fileName.back() == '/') { // Create directory From 883ea0be88346bf14a6f32d6051a807f25fd7986 Mon Sep 17 00:00:00 2001 From: Remy Raes Date: Fri, 26 May 2023 17:28:51 +0200 Subject: [PATCH 78/78] style: reformat verifiedmods.cpp --- NorthstarDLL/mods/verified/verifiedmods.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/NorthstarDLL/mods/verified/verifiedmods.cpp b/NorthstarDLL/mods/verified/verifiedmods.cpp index 0372d6073..285ab9b7b 100644 --- a/NorthstarDLL/mods/verified/verifiedmods.cpp +++ b/NorthstarDLL/mods/verified/verifiedmods.cpp @@ -321,7 +321,6 @@ void DownloadMod(char* modName, char* modVersion) spdlog::info(" => {}", fileName); std::filesystem::path destination = std::filesystem::path(GetNorthstarPrefix()) / fileName; - // From time to time, file entries appear before directory containing // them, so we need to create the latter before extracting the file. // e.g.: @@ -340,7 +339,6 @@ void DownloadMod(char* modName, char* modVersion) } } - if (fileName.back() == '/') { // Create directory