summaryrefslogtreecommitdiffhomepage
path: root/Private
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-04-08 00:44:48 +0200
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-04-08 00:44:48 +0200
commit7ec2bda484072982e75666508863ef9903331191 (patch)
tree38a8ef82921367a3643afb282d2cfd6b19124960 /Private
parentdd9c90c0d7d65f4481b1072f11cbb81017382006 (diff)
Kernel/URL.cxx: Remove useless protocols for a kernel.
- remove IteratorInterface for NewFS, design change have been done. Kernel/NewFS.cxx: Document code.
Diffstat (limited to 'Private')
-rw-r--r--Private/CFKit/URL.hpp6
-rw-r--r--Private/CRT/__mpcc_alloca.hxx (renamed from Private/CRT/__cxxkit_alloca.hxx)2
-rw-r--r--Private/CRT/__mpcc_defines.hxx (renamed from Private/CRT/__cxxkit_defines.hxx)12
-rw-r--r--Private/FSKit/NewFSIteratorInterface.hxx51
-rw-r--r--Private/NewKit/Defines.hpp2
-rw-r--r--Private/Source/FS/NewFS.cxx35
-rw-r--r--Private/Source/URL.cxx15
7 files changed, 51 insertions, 72 deletions
diff --git a/Private/CFKit/URL.hpp b/Private/CFKit/URL.hpp
index 748b3cf0..41693e0e 100644
--- a/Private/CFKit/URL.hpp
+++ b/Private/CFKit/URL.hpp
@@ -11,10 +11,10 @@
#include <NewKit/String.hpp>
namespace NewOS {
-class Url final {
+class URL final {
public:
- explicit Url(StringView &strUrl);
- ~Url();
+ explicit URL(StringView &strUrl);
+ ~URL();
public:
Ref<ErrorOr<StringView>> Location() noexcept;
diff --git a/Private/CRT/__cxxkit_alloca.hxx b/Private/CRT/__mpcc_alloca.hxx
index e106a373..5b6d81e4 100644
--- a/Private/CRT/__cxxkit_alloca.hxx
+++ b/Private/CRT/__mpcc_alloca.hxx
@@ -9,4 +9,4 @@
typedef void* ptr_type;
typedef __SIZE_TYPE__ size_type;
-inline void* __cxxkit_alloca_gcc(size_type sz) { return __builtin_alloca(sz); }
+inline void* __mpcc_alloca_gcc(size_type sz) { return __builtin_alloca(sz); }
diff --git a/Private/CRT/__cxxkit_defines.hxx b/Private/CRT/__mpcc_defines.hxx
index 54b50716..a9436a1b 100644
--- a/Private/CRT/__cxxkit_defines.hxx
+++ b/Private/CRT/__mpcc_defines.hxx
@@ -4,8 +4,8 @@
------------------------------------------- */
-#ifndef __CXXKIT_DEF__
-#define __CXXKIT_DEF__
+#ifndef __MPCC_DEF__
+#define __MPCC_DEF__
typedef __SIZE_TYPE__ size_t;
@@ -26,11 +26,11 @@ typedef char *caddr_t;
#endif // !null
#ifdef __GNUC__
-#include <CRT/__cxxkit_alloca.hxx>
-#define __cxxkit_alloca(sz) __cxxkit_alloca_gcc(sz)
+#include <CRT/__mpcc_alloca.hxx>
+#define __mpcc_alloca(sz) __mpcc_alloca_gcc(sz)
#elif defined(__MPCC__)
-#define __alloca(sz) __cxxkit_alloca(sz)
+#define __alloca(sz) __mpcc_alloca(sz)
#endif
#define __deref(ptr) (*(ptr))
@@ -82,4 +82,4 @@ typedef union double_cast {
double f;
} __attribute__((packed)) double_cast_t;
-#endif /* __CXXKIT_DEF__ */
+#endif /* __MPCC_DEF__ */
diff --git a/Private/FSKit/NewFSIteratorInterface.hxx b/Private/FSKit/NewFSIteratorInterface.hxx
deleted file mode 100644
index d0d35c76..00000000
--- a/Private/FSKit/NewFSIteratorInterface.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#pragma once
-
-#include <FSKit/IndexableProperty.hxx>
-#include <NewKit/MutableArray.hpp>
-
-namespace NewOS {
-namespace Indexer {
-class NewFSIteratorInterface;
-
-using IndexElement = VoidPtr;
-
-///
-/// @name NewFSIteratorInterface
-/// @brief Stores relevant information for file indexing.
-///
-
-class NewFSIteratorInterface {
- public:
- explicit NewFSIteratorInterface() = default;
- virtual ~NewFSIteratorInterface() = default;
-
- public:
- NEWOS_COPY_DEFAULT(NewFSIteratorInterface);
-
- public:
- void Append(IndexableProperty& indexProp) { fProps.Add(indexProp); }
-
- MutableArray<IndexableProperty>& Leak() { return fProps; }
-
- Boolean Find(IndexProperty& filters) {
- for (size_t i = 0; i < fProps.Count(); ++i) {
- if (StringBuilder::Equals(fProps[i].Leak().LeakProperty().Path,
- filters.Path)) {
- return i;
- }
- }
-
- return 0;
- }
-
- private:
- MutableArray<IndexableProperty> fProps;
-};
-} // namespace Indexer
-} // namespace NewOS
diff --git a/Private/NewKit/Defines.hpp b/Private/NewKit/Defines.hpp
index e2951174..a3b86234 100644
--- a/Private/NewKit/Defines.hpp
+++ b/Private/NewKit/Defines.hpp
@@ -11,7 +11,7 @@
#define NEWKIT_VERSION "1.01"
#if !defined(_INC_NO_STDC_HEADERS) && defined(__GNUC__)
-#include <CRT/__cxxkit_defines.hxx>
+#include <CRT/__mpcc_defines.hxx>
#endif
#ifdef __has_feature
diff --git a/Private/Source/FS/NewFS.cxx b/Private/Source/FS/NewFS.cxx
index ac38400a..012cb3d2 100644
--- a/Private/Source/FS/NewFS.cxx
+++ b/Private/Source/FS/NewFS.cxx
@@ -162,36 +162,69 @@ bool NewFSParser::WriteCatalog(_Input _Output NewCatalog* catalog,
return false;
}
+/// @brief
+/// @param catalogName
+/// @return
_Output NewCatalog* NewFSParser::FindCatalog(_Input const char* catalogName) {
return nullptr;
}
+/// @brief
+/// @param name
+/// @return
_Output NewCatalog* NewFSParser::GetCatalog(_Input const char* name) {
return nullptr;
}
+/// @brief
+/// @param catalog
+/// @return
Boolean NewFSParser::CloseCatalog(_Input _Output NewCatalog* catalog) {
return false;
}
+/// @brief
+/// @param catalog
+/// @return
Boolean NewFSParser::RemoveCatalog(_Input _Output NewCatalog* catalog) {
return false;
}
-
+/// @brief
+/// @param catalog
+/// @param dataSz
+/// @return
VoidPtr NewFSParser::ReadCatalog(_Input _Output NewCatalog* catalog,
SizeT dataSz) {
return nullptr;
}
+/// @brief
+/// @param catalog
+/// @param off
+/// @return
bool NewFSParser::Seek(_Input _Output NewCatalog* catalog, SizeT off) {
return false;
}
+/// @brief
+/// @param catalog
+/// @return
SizeT NewFSParser::Tell(_Input _Output NewCatalog* catalog) { return 0; }
+/// @brief
+/// @param sz
+/// @return
STATIC Lba ke_find_free_fork(SizeT sz) { return 0; }
+
+/// @brief
+/// @param sz
+/// @return
STATIC Lba ke_find_free_catalog(SizeT sz) { return 0; }
+
+/// @brief
+/// @param sz
+/// @return
STATIC Lba ke_find_free_data(SizeT sz) { return 0; }
namespace NewOS::Detail {
diff --git a/Private/Source/URL.cxx b/Private/Source/URL.cxx
index ebb325c1..090c7c66 100644
--- a/Private/Source/URL.cxx
+++ b/Private/Source/URL.cxx
@@ -11,18 +11,15 @@
/// BUGS: 0
namespace NewOS {
-Url::Url(StringView &strUrl) : fUrlView(strUrl, false) {}
+URL::URL(StringView &strUrl) : fUrlView(strUrl, false) {}
-Url::~Url() = default;
+URL::~URL() = default;
constexpr const char *kURLProtocols[] = {
- "file", // Filesystem protocol
- "ping", // Ping protocol.
- "telnet", // Telnet protocol
- "ssh", // SSH protocol
+ "file", // Filesystem protocol
};
-constexpr const int kUrlOutSz = 3; //! such as: ://
+constexpr const int kUrlOutSz = 1; //! such as: ://
constexpr const int kProtosCount = 4;
constexpr const int kRangeSz = 4096;
@@ -62,7 +59,7 @@ ErrorOr<StringView> url_extract_protocol(const char *url) {
return view;
}
-Ref<ErrorOr<StringView>> Url::Location() noexcept {
+Ref<ErrorOr<StringView>> URL::Location() noexcept {
const char *src = fUrlView.Leak().CData();
auto loc = url_extract_location(src);
@@ -71,7 +68,7 @@ Ref<ErrorOr<StringView>> Url::Location() noexcept {
return Ref<ErrorOr<StringView>>(loc);
}
-Ref<ErrorOr<StringView>> Url::Protocol() noexcept {
+Ref<ErrorOr<StringView>> URL::Protocol() noexcept {
const char *src = fUrlView.Leak().CData();
auto loc = url_extract_protocol(src);