From d48cbe75ef29a9c67c9d176bf58e56ea6448fb9e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Mon, 21 Oct 2024 20:23:36 +0200 Subject: IMP: Major refactor of header and source files extensions. Signed-off-by: Amlal El Mahrouss --- dev/base/EncryptFS/build.json | 2 +- dev/base/EncryptFS/disk_crypt.h | 31 +++++++++++++++++++++ dev/base/EncryptFS/disk_crypt.hxx | 31 --------------------- dev/base/EncryptFS/src/disk_crypt.cc | 14 ++++++++++ dev/base/EncryptFS/src/disk_crypt.cxx | 14 ---------- dev/base/FireWall/fwapi.h | 7 +++++ dev/base/FireWall/fwapi.hxx | 7 ----- dev/base/FireWall/src/fwentry.cc | 2 +- dev/base/RunDLL64/build.json | 2 +- dev/base/RunDLL64/src/dll.cc | 26 ++++++++++++++++++ dev/base/RunDLL64/src/dll.cxx | 26 ------------------ dev/base/RunXPCOM/build.json | 2 +- dev/base/RunXPCOM/src/xpcom.cc | 32 ++++++++++++++++++++++ dev/base/RunXPCOM/src/xpcom.cxx | 32 ---------------------- dev/base/View/pdf.h | 51 +++++++++++++++++++++++++++++++++++ dev/base/View/pdf.hxx | 51 ----------------------------------- dev/base/View/src/app.cc | 0 dev/base/View/src/app.cxx | 0 dev/base/View/src/pdf.cc | 7 +++++ dev/base/View/src/pdf.cxx | 7 ----- dev/base/View/src/viewer_box.cc | 0 dev/base/View/src/viewer_box.cxx | 0 dev/base/View/view.json | 2 +- dev/base/View/viewer_box.h | 0 dev/base/View/viewer_box.hxx | 0 25 files changed, 173 insertions(+), 173 deletions(-) create mode 100644 dev/base/EncryptFS/disk_crypt.h delete mode 100644 dev/base/EncryptFS/disk_crypt.hxx create mode 100644 dev/base/EncryptFS/src/disk_crypt.cc delete mode 100644 dev/base/EncryptFS/src/disk_crypt.cxx create mode 100644 dev/base/FireWall/fwapi.h delete mode 100644 dev/base/FireWall/fwapi.hxx create mode 100644 dev/base/RunDLL64/src/dll.cc delete mode 100644 dev/base/RunDLL64/src/dll.cxx create mode 100644 dev/base/RunXPCOM/src/xpcom.cc delete mode 100644 dev/base/RunXPCOM/src/xpcom.cxx create mode 100644 dev/base/View/pdf.h delete mode 100644 dev/base/View/pdf.hxx create mode 100644 dev/base/View/src/app.cc delete mode 100644 dev/base/View/src/app.cxx create mode 100644 dev/base/View/src/pdf.cc delete mode 100644 dev/base/View/src/pdf.cxx create mode 100644 dev/base/View/src/viewer_box.cc delete mode 100644 dev/base/View/src/viewer_box.cxx create mode 100644 dev/base/View/viewer_box.h delete mode 100644 dev/base/View/viewer_box.hxx (limited to 'dev/base') diff --git a/dev/base/EncryptFS/build.json b/dev/base/EncryptFS/build.json index 1f9b018e..4dcefa38 100644 --- a/dev/base/EncryptFS/build.json +++ b/dev/base/EncryptFS/build.json @@ -2,7 +2,7 @@ "compiler_path": "x86_64-w64-mingw32-g++", "compiler_std": "c++20", "headers_path": ["../", "./"], - "sources_path": ["src/*.cxx"], + "sources_path": ["src/*.cc"], "output_name": "efs.zsc", "compiler_flags": [ "-ffreestanding", diff --git a/dev/base/EncryptFS/disk_crypt.h b/dev/base/EncryptFS/disk_crypt.h new file mode 100644 index 00000000..981ebc78 --- /dev/null +++ b/dev/base/EncryptFS/disk_crypt.h @@ -0,0 +1,31 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + + File: disk_encrypt.h + Purpose: Disk Encryption File System + + Revision History: + + 8/8/2024: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include + +namespace Kernel +{ + /**************************************** */ + /// @brief Locks an EFS partition. + /**************************************** */ + + Int32 efs_lock_partition(const Char* partition_name, const Char* password, SizeT length); + + /**************************************** */ + /// @brief Unlocks an EFS partition. + /**************************************** */ + + Int32 efs_unlock_partition(const Char* partition_name, const Char* password, SizeT length); +} // namespace Kernel diff --git a/dev/base/EncryptFS/disk_crypt.hxx b/dev/base/EncryptFS/disk_crypt.hxx deleted file mode 100644 index 3ec4799d..00000000 --- a/dev/base/EncryptFS/disk_crypt.hxx +++ /dev/null @@ -1,31 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - - File: disk_encrypt.hxx - Purpose: Disk Encryption File System - - Revision History: - - 8/8/2024: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include - -namespace Kernel -{ - /**************************************** */ - /// @brief Locks an EFS partition. - /**************************************** */ - - Int32 efs_lock_partition(const Char* partition_name, const Char* password, SizeT length); - - /**************************************** */ - /// @brief Unlocks an EFS partition. - /**************************************** */ - - Int32 efs_unlock_partition(const Char* partition_name, const Char* password, SizeT length); -} // namespace Kernel diff --git a/dev/base/EncryptFS/src/disk_crypt.cc b/dev/base/EncryptFS/src/disk_crypt.cc new file mode 100644 index 00000000..334e2d4d --- /dev/null +++ b/dev/base/EncryptFS/src/disk_crypt.cc @@ -0,0 +1,14 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#include + +enum +{ + kEFSFlagEncryptedFree = 0x00, + kEFSFlagEncryptedUnlocked = 0x3f, + kEFSFlagEncryptedLock = 0xf3, +}; diff --git a/dev/base/EncryptFS/src/disk_crypt.cxx b/dev/base/EncryptFS/src/disk_crypt.cxx deleted file mode 100644 index 031a2528..00000000 --- a/dev/base/EncryptFS/src/disk_crypt.cxx +++ /dev/null @@ -1,14 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#include - -enum -{ - kEFSFlagEncryptedFree = 0x00, - kEFSFlagEncryptedUnlocked = 0x3f, - kEFSFlagEncryptedLock = 0xf3, -}; diff --git a/dev/base/FireWall/fwapi.h b/dev/base/FireWall/fwapi.h new file mode 100644 index 00000000..cd916657 --- /dev/null +++ b/dev/base/FireWall/fwapi.h @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2024 ZKA Web Services Co + */ + +#pragma once + +#include diff --git a/dev/base/FireWall/fwapi.hxx b/dev/base/FireWall/fwapi.hxx deleted file mode 100644 index dfa9d30c..00000000 --- a/dev/base/FireWall/fwapi.hxx +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright (c) 2024 ZKA Web Services Co - */ - -#pragma once - -#include diff --git a/dev/base/FireWall/src/fwentry.cc b/dev/base/FireWall/src/fwentry.cc index 37e5f304..3fb739f7 100644 --- a/dev/base/FireWall/src/fwentry.cc +++ b/dev/base/FireWall/src/fwentry.cc @@ -2,4 +2,4 @@ * Copyright (c) 2024 ZKA Web Services Co */ -#include +#include diff --git a/dev/base/RunDLL64/build.json b/dev/base/RunDLL64/build.json index c53373a9..b129f8e4 100644 --- a/dev/base/RunDLL64/build.json +++ b/dev/base/RunDLL64/build.json @@ -2,7 +2,7 @@ "compiler_path": "x86_64-w64-mingw32-g++", "compiler_std": "c++20", "headers_path": ["../", "./", "../../"], - "sources_path": ["src/*.cxx"], + "sources_path": ["src/*.cc"], "output_name": "rundll64.exe", "compiler_flags": [ "-ffreestanding", diff --git a/dev/base/RunDLL64/src/dll.cc b/dev/base/RunDLL64/src/dll.cc new file mode 100644 index 00000000..ee3cdfa6 --- /dev/null +++ b/dev/base/RunDLL64/src/dll.cc @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 ZKA Web Services Co + */ + +#include + +typedef int (*MainKind)(int, char**); + +int main(int argc, char* argv[]) +{ + if (argc < 3) + return -1; + + auto mainDll = LdrOpenDLL(argv[1], argv[2]); + + int (*entrypointOff)(int, char**) = (MainKind)LdrGetDLLProc(argv[3], mainDll); + + if (!entrypointOff) + return -1; + + int ret = entrypointOff(argc, argv); + + LdrCloseDLL(mainDll); + + return ret; +} diff --git a/dev/base/RunDLL64/src/dll.cxx b/dev/base/RunDLL64/src/dll.cxx deleted file mode 100644 index 49e69fc4..00000000 --- a/dev/base/RunDLL64/src/dll.cxx +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2024 ZKA Web Services Co - */ - -#include - -typedef int (*MainKind)(int, char**); - -int main(int argc, char* argv[]) -{ - if (argc < 3) - return -1; - - auto mainDll = LdrOpenDLL(argv[1], argv[2]); - - int (*entrypointOff)(int, char**) = (MainKind)LdrGetDLLProc(argv[3], mainDll); - - if (!entrypointOff) - return -1; - - int ret = entrypointOff(argc, argv); - - LdrCloseDLL(mainDll); - - return ret; -} diff --git a/dev/base/RunXPCOM/build.json b/dev/base/RunXPCOM/build.json index 45d249b8..ec91d543 100644 --- a/dev/base/RunXPCOM/build.json +++ b/dev/base/RunXPCOM/build.json @@ -2,7 +2,7 @@ "compiler_path": "x86_64-w64-mingw32-g++", "compiler_std": "c++20", "headers_path": ["../", "./", "../../"], - "sources_path": ["src/*.cxx"], + "sources_path": ["src/*.cc"], "output_name": "runxpcom.exe", "compiler_flags": [ "-ffreestanding", diff --git a/dev/base/RunXPCOM/src/xpcom.cc b/dev/base/RunXPCOM/src/xpcom.cc new file mode 100644 index 00000000..3fcfc708 --- /dev/null +++ b/dev/base/RunXPCOM/src/xpcom.cc @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 ZKA Web Services Co + */ + +#include + +typedef SInt32 (*RPCProcKind)(IUnknown*); + +/** + * @brief Main procedure for DLL runner. + */ +int main(int argc, char* argv[]) +{ + if (argc < 4) + return -1; + + auto mainDll = LdrOpenDLL(argv[1], argv[2]); + + IUnknown* interface = (IUnknown*)LdrGetDLLProc(argv[3], mainDll); + RPCProcKind dllRpc = (RPCProcKind)LdrGetDLLProc(argv[4], mainDll); + + if (!dllRpc) + return -1; + if (!interface) + return -1; + + auto ret = dllRpc(interface); + + LdrCloseDLL(mainDll); + + return ret; +} diff --git a/dev/base/RunXPCOM/src/xpcom.cxx b/dev/base/RunXPCOM/src/xpcom.cxx deleted file mode 100644 index 1b94ba07..00000000 --- a/dev/base/RunXPCOM/src/xpcom.cxx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2024 ZKA Web Services Co - */ - -#include - -typedef SInt32 (*RPCProcKind)(IUnknown*); - -/** - * @brief Main procedure for DLL runner. - */ -int main(int argc, char* argv[]) -{ - if (argc < 4) - return -1; - - auto mainDll = LdrOpenDLL(argv[1], argv[2]); - - IUnknown* interface = (IUnknown*)LdrGetDLLProc(argv[3], mainDll); - RPCProcKind dllRpc = (RPCProcKind)LdrGetDLLProc(argv[4], mainDll); - - if (!dllRpc) - return -1; - if (!interface) - return -1; - - auto ret = dllRpc(interface); - - LdrCloseDLL(mainDll); - - return ret; -} diff --git a/dev/base/View/pdf.h b/dev/base/View/pdf.h new file mode 100644 index 00000000..b28806d7 --- /dev/null +++ b/dev/base/View/pdf.h @@ -0,0 +1,51 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#pragma once + +#include + +namespace View::PDF +{ + class IPDF; + class IPDFDocument; + class IPDFTimestamp; + class IPDFTag; + + /// \brief PDF manipulator class. + class IPDF + { + public: + explicit IPDF() = default; + virtual ~IPDF() = default; + + IPDF& operator=(const IPDF&) = delete; + IPDF(const IPDF&) = delete; + + virtual IPDFDocument* GetFirstPage() = 0; + virtual IPDFDocument* GetLastPage() = 0; + + virtual IPDFDocument* GetPage(const UInt32& page_number); + virtual SInt32 SetPage(const UInt32& page_number, IPDFDocument* new_page); + + virtual Void SetProducer(const Char*) = 0; + virtual Void SetTitle(const Char*) = 0; + virtual Void SetAuthor(const Char*) = 0; + virtual Void SetSubject(const Char*) = 0; + + virtual const Char* GetProducer() = 0; + virtual const Char* GetTitle() = 0; + virtual const Char* GetAuthor() = 0; + virtual const Char* GetSubject() = 0; + + virtual Bool IsFastView() = 0; + + virtual SizeT GetWidth() = 0; + virtual SizeT GetHeight() = 0; + + virtual SizeT GetPageCount() = 0; + }; +} // namespace View::PDF diff --git a/dev/base/View/pdf.hxx b/dev/base/View/pdf.hxx deleted file mode 100644 index aac8c5a7..00000000 --- a/dev/base/View/pdf.hxx +++ /dev/null @@ -1,51 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#pragma once - -#include - -namespace View::PDF -{ - class IPDF; - class IPDFDocument; - class IPDFTimestamp; - class IPDFTag; - - /// \brief PDF manipulator class. - class IPDF - { - public: - explicit IPDF() = default; - virtual ~IPDF() = default; - - IPDF& operator=(const IPDF&) = delete; - IPDF(const IPDF&) = delete; - - virtual IPDFDocument* GetFirstPage() = 0; - virtual IPDFDocument* GetLastPage() = 0; - - virtual IPDFDocument* GetPage(const UInt32& page_number); - virtual SInt32 SetPage(const UInt32& page_number, IPDFDocument* new_page); - - virtual Void SetProducer(const Char*) = 0; - virtual Void SetTitle(const Char*) = 0; - virtual Void SetAuthor(const Char*) = 0; - virtual Void SetSubject(const Char*) = 0; - - virtual const Char* GetProducer() = 0; - virtual const Char* GetTitle() = 0; - virtual const Char* GetAuthor() = 0; - virtual const Char* GetSubject() = 0; - - virtual Bool IsFastView() = 0; - - virtual SizeT GetWidth() = 0; - virtual SizeT GetHeight() = 0; - - virtual SizeT GetPageCount() = 0; - }; -} // namespace View::PDF diff --git a/dev/base/View/src/app.cc b/dev/base/View/src/app.cc new file mode 100644 index 00000000..e69de29b diff --git a/dev/base/View/src/app.cxx b/dev/base/View/src/app.cxx deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/base/View/src/pdf.cc b/dev/base/View/src/pdf.cc new file mode 100644 index 00000000..2f5e628e --- /dev/null +++ b/dev/base/View/src/pdf.cc @@ -0,0 +1,7 @@ +/* ------------------------------------------- + + Copyright ZKA Web Services Co. + +------------------------------------------- */ + +#include diff --git a/dev/base/View/src/pdf.cxx b/dev/base/View/src/pdf.cxx deleted file mode 100644 index c226e306..00000000 --- a/dev/base/View/src/pdf.cxx +++ /dev/null @@ -1,7 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Web Services Co. - -------------------------------------------- */ - -#include diff --git a/dev/base/View/src/viewer_box.cc b/dev/base/View/src/viewer_box.cc new file mode 100644 index 00000000..e69de29b diff --git a/dev/base/View/src/viewer_box.cxx b/dev/base/View/src/viewer_box.cxx deleted file mode 100644 index e69de29b..00000000 diff --git a/dev/base/View/view.json b/dev/base/View/view.json index 9033eaec..ba9f979f 100644 --- a/dev/base/View/view.json +++ b/dev/base/View/view.json @@ -2,7 +2,7 @@ "compiler_path": "x86_64-w64-mingw32-g++", "compiler_std": "c++20", "headers_path": ["../../", "....//zka"], - "sources_path": ["src/*.cxx"], + "sources_path": ["src/*.cc"], "output_name": "View.exe", "compiler_flags": [ "-fPIC", diff --git a/dev/base/View/viewer_box.h b/dev/base/View/viewer_box.h new file mode 100644 index 00000000..e69de29b diff --git a/dev/base/View/viewer_box.hxx b/dev/base/View/viewer_box.hxx deleted file mode 100644 index e69de29b..00000000 -- cgit v1.2.3