diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-21 22:39:57 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-21 22:39:57 +0100 |
| commit | 80b76666074aa94f165e3db7b3dda2145ca6efc0 (patch) | |
| tree | ba8a189df55f3dab4d3623eb4617c7b5d33c7f07 /Public/Kits/System.Zip | |
| parent | dafcc53840c41dab7a1897868d020a5b196d5b2d (diff) | |
unstable, kernel+api: important breaking changes.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Kits/System.Zip')
| -rw-r--r-- | Public/Kits/System.Zip/Defines.hpp | 30 | ||||
| -rw-r--r-- | Public/Kits/System.Zip/Makefile | 22 | ||||
| -rw-r--r-- | Public/Kits/System.Zip/Shell.hpp | 17 | ||||
| -rw-r--r-- | Public/Kits/System.Zip/Zip.cxx | 43 | ||||
| -rw-r--r-- | Public/Kits/System.Zip/Zip.hpp | 37 | ||||
| -rw-r--r-- | Public/Kits/System.Zip/compile_flags.txt | 4 |
6 files changed, 0 insertions, 153 deletions
diff --git a/Public/Kits/System.Zip/Defines.hpp b/Public/Kits/System.Zip/Defines.hpp deleted file mode 100644 index a894b672..00000000 --- a/Public/Kits/System.Zip/Defines.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include <System.Core/System.hxx> - -#define ZIPKIT_VERSION "1.01" - -/// @brief Zip compression function -/// @param dest -/// @param destLen -/// @param source -/// @param sourceLen -/// @return -CA_EXTERN_C DWORD HcCompress(BYTE *dest, QWORD *destLen, const BYTE *source, - QWORD sourceLen); - -/// @brief Zip uncompression function -/// @param dest -/// @param destLen -/// @param source -/// @param sourceLen -/// @return -CA_EXTERN_C DWORD HcUncompress(BYTE *dest, QWORD *destLen, - const BYTE *source, QWORD sourceLen); - diff --git a/Public/Kits/System.Zip/Makefile b/Public/Kits/System.Zip/Makefile deleted file mode 100644 index 8069ce4b..00000000 --- a/Public/Kits/System.Zip/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -################################################## -# (C) Mahrouss Logic, 2024, all rights reserved. -# This is the System.Zip Makefile. -################################################## - -CC=x86_64-w64-mingw32-g++ -CCFLAGS=-shared -ffreestanding -fno-rtti -fno-exceptions -std=c++20 -Xlinker --subsystem=17 -ASM=nasm -ASMFLAGS=-f elf64 -OUTPUT=System.Zip.dll - -.PHONY: build-zip -build-zip: - $(CC) -I../ -I../../../Private/ $(CCFLAGS) *.cxx -o $(OUTPUT) - -.PHONY: all -all: build-zip - @echo "[System.Zip.dll] Done." - -.PHONY: clean -clean: - rm -f *.o diff --git a/Public/Kits/System.Zip/Shell.hpp b/Public/Kits/System.Zip/Shell.hpp deleted file mode 100644 index 19de8f07..00000000 --- a/Public/Kits/System.Zip/Shell.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -/// TODO: integrate compression into the shell. - -/// @brief NewFS catalog is compressed. -#define kNewFSIsZip 255 - -/// @brief NewFS catalog has password attached to it. -#define kNewFSHasPassword 256 - -class ShellInterface; diff --git a/Public/Kits/System.Zip/Zip.cxx b/Public/Kits/System.Zip/Zip.cxx deleted file mode 100644 index 60d53ffb..00000000 --- a/Public/Kits/System.Zip/Zip.cxx +++ /dev/null @@ -1,43 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#include <System.Zip/Zip.hpp> -#include <System.Core/Defs.hxx> - -#define kZipInitialSize 4096 - -namespace System::Zip { -ZipStream::ZipStream() - : fSharedData(System::Heap::Shared()->New(kZipInitialSize, kHeapExpandable)), - fSharedSz(kZipInitialSize) {} - -ZipStream::~ZipStream() noexcept { - if (fSharedData) System::Heap::Shared()->Delete(fSharedData); -} - -FilePtr ZipStream::FlushToFile(const char *name) { - FilePtr fp = new File(name); - CA_MUST_PASS(fp); - - this->fSharedSz = System::Heap::Shared()->Size(this->fSharedData); - - fp->MIME(kZipKitMime); - fp->Write(this->fSharedData, this->fSharedSz); - - return fp; -} - -void *ZipStream::Deflate(const char *name) { - QWORD tmpSharedSz = this->fSharedSz; - HcUncompress((BYTE*)this->fSharedData, &this->fSharedSz, (BYTE*)this->fSharedData, tmpSharedSz); - - return this->fSharedData; -} - -void ZipStream::Inflate(const char *name, BYTE *data, QWORD dataLen) { - HcCompress((BYTE*)this->fSharedData, &this->fSharedSz, (BYTE*)data, dataLen); -} -} // namespace System.Zip diff --git a/Public/Kits/System.Zip/Zip.hpp b/Public/Kits/System.Zip/Zip.hpp deleted file mode 100644 index 425d3cc8..00000000 --- a/Public/Kits/System.Zip/Zip.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#define Z_SOLO 1 - -#include <CompilerKit/CompilerKit.hxx> -#include <System.Zip/Defines.hpp> - -namespace System::Zip { -class ZipStream; - -class ZipStream final { - public: - explicit ZipStream(); - ~ZipStream() noexcept; - - public: - HCORE_COPY_DEFAULT(ZipStream); - - public: - FilePtr FlushToFile(const char *name); - void *Deflate(const char *name); - void Inflate(const char *name, BYTE *data, QWORD sz); - - private: - VoidPtr fSharedData{nullptr}; - SizeT fSharedSz{0}; - -}; -} // namespace System.Zip - -#define kZipKitMime "application/x-bzip" diff --git a/Public/Kits/System.Zip/compile_flags.txt b/Public/Kits/System.Zip/compile_flags.txt deleted file mode 100644 index 6e721e73..00000000 --- a/Public/Kits/System.Zip/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../../../Private --std=c++20 |
