diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-10-14 04:35:26 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-10-14 04:35:26 +0200 |
| commit | a786997f304745ce3766a82be06dc6a5d0c2f02c (patch) | |
| tree | db923caaec3762fbb68290fd1ae94cb1465378e7 | |
| parent | fa4748e414e9494442f9bcde9c659d3951af19c0 (diff) | |
feat: scl: major refactors and new version of SCL.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
33 files changed, 126 insertions, 123 deletions
@@ -74,7 +74,7 @@ PROJECT_ICON = # entered, it will be relative to the location where Doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ./ocl/docs +OUTPUT_DIRECTORY = ./scl/docs # If the CREATE_SUBDIRS tag is set to YES then Doxygen will create up to 4096 # sub-directories (in 2 levels) under the output directory of each output format @@ -991,7 +991,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = /Volumes/Projects/src/ocl +INPUT = /Volumes/Projects/src/scl # This tag can be used to specify the character encoding of the source files # that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses @@ -21,8 +21,8 @@ A C++ library with additional modules for your C++ SDLC. Based on the Open C++ L int main(int argc, char** argv) { - auto opt = ocl::opt(ocl::eval_eq(50, 50)).try_or_throw("ocl::eval_eq, does not match!"); - opt = ocl::opt(ocl::eval_eq(50, 40)); + auto opt = scl::opt(scl::eval_eq(50, 50)).try_or_throw("scl::eval_eq, does not match!"); + opt = scl::opt(scl::eval_eq(50, 40)); opt.try_or_throw("this time it doesn't."); return EXIT_SUCCESS; diff --git a/compile_flags.txt b/compile_flags.txt index 1c9f6fb..da935d4 100644 --- a/compile_flags.txt +++ b/compile_flags.txt @@ -2,4 +2,4 @@ -std=c++20 -DEMBFS_28BIT_LBA -xc++ --I/opt/homebrew/Cellar/boost/1.87.0/include
\ No newline at end of file +-I/opt/homebrew/Cellar/boost/1.89.0/include
\ No newline at end of file diff --git a/dev/examples/allocator_system/allocator_system.cc b/dev/examples/allocator_system/allocator_system.cc index c3cd689..169cd97 100644 --- a/dev/examples/allocator_system/allocator_system.cc +++ b/dev/examples/allocator_system/allocator_system.cc @@ -8,10 +8,11 @@ #include <lib/core/allocator_system.hpp> #include <iostream> -struct MyClass +class MyClass final { - int a; - std::string b; +public: + int a{}; + std::string b{}; MyClass() : a(0), b("default") { @@ -31,17 +32,19 @@ struct MyClass int main() { - using Alloc = ocl::standard_allocator_type<MyClass>; - Alloc allocator; + scl::standard_allocator_type<MyClass> allocator; // Test 1: claim() + unclaim() std::cout << "=== Test 1: claim/unclaim ===\n"; + MyClass* raw = allocator.claim(); + std::cout << "raw->a = " << raw->a << ", raw->b = " << raw->b << "\n"; allocator.unclaim(raw); // Manual delete // Test 2: construct() → shared_ptr std::cout << "\n=== Test 2: construct (shared_ptr) ===\n"; + auto ptr = allocator.construct<int, std::string>(42, "hello"); std::cout << "ptr->a = " << ptr->a << ", ptr->b = " << ptr->b << "\n"; diff --git a/dev/examples/cgi/cgi.cc b/dev/examples/cgi/cgi.cc index 692f90c..6f73eff 100644 --- a/dev/examples/cgi/cgi.cc +++ b/dev/examples/cgi/cgi.cc @@ -6,7 +6,7 @@ #include <lib/utility/cgi_writer.hpp> -static ocl::basic_chunk_string<char> text_sample = R"( +static scl::basic_chunk_string<char> text_sample = R"( <!DOCTYPE html> <html> <head> @@ -68,7 +68,7 @@ static ocl::basic_chunk_string<char> text_sample = R"( /* @brief this stub loads a 'index.html' or returns an error message if not found. */ int main(int argc, char** argv) { - ocl::cgi::basic_writer<> writer; + scl::cgi::basic_writer<> writer; writer << text_sample; return 0; diff --git a/dev/examples/equiv/equiv.cc b/dev/examples/equiv/equiv.cc index 12207f4..9d41afb 100644 --- a/dev/examples/equiv/equiv.cc +++ b/dev/examples/equiv/equiv.cc @@ -11,9 +11,9 @@ int main(int argc, char** argv) { std::cout << std::boolalpha; - std::cout << ocl::equiv::is_same<bool, int>::value << std::endl; - std::cout << ocl::equiv::is_same<bool, bool>::value << std::endl; - std::cout << ocl::equiv::is_same<int, int>::value << std::endl; + std::cout << scl::equiv::is_same<bool, int>::value << std::endl; + std::cout << scl::equiv::is_same<bool, bool>::value << std::endl; + std::cout << scl::equiv::is_same<int, int>::value << std::endl; return 0; } diff --git a/dev/examples/fix/fix.cc b/dev/examples/fix/fix.cc index ec6668a..aaac979 100644 --- a/dev/examples/fix/fix.cc +++ b/dev/examples/fix/fix.cc @@ -15,14 +15,14 @@ int main(int argc, char** argv) { constexpr auto default_fix = "8=FIX.4.2|9=65|35=A|49=SERVER|56=CLIENT|34=177|52=20090107-18:15:16|98=0|108=30|10=062|"; - ocl::fix::basic_visitor<char> basic_visitor; - ocl::fix::basic_range_data<char> fix = basic_visitor.visit(default_fix); + scl::fix::basic_visitor<char> basic_visitor; + scl::fix::basic_range_data<char> fix = basic_visitor.visit(default_fix); std::cout << "magic=" << fix.magic_ << std::endl; std::cout << "magic_len=" << fix.magic_len_ << std::endl; std::cout << "is_valid=" << std::boolalpha << fix.is_valid() << std::endl; - ocl::fix::must_pass(fix); + scl::fix::must_pass(fix); for (auto fields : fix.body_) { diff --git a/dev/examples/opt/opt.cc b/dev/examples/opt/opt.cc index 8a74fa2..eb725c4 100644 --- a/dev/examples/opt/opt.cc +++ b/dev/examples/opt/opt.cc @@ -26,7 +26,7 @@ static auto do_some(const std::string recv_data, const std::string check_data) const int hash_to_check = do_hash(check_data); /* here we assume this should match opt_hash */ const int opt_hash = do_hash(recv_data); /* we assume that the hash is correct */ - auto opt = ocl::opt(ocl::eval_eq(hash_to_check, opt_hash)); /* do the compute */ + auto opt = scl::opt(scl::eval_eq(hash_to_check, opt_hash)); /* do the compute */ return opt; } @@ -35,7 +35,7 @@ int main(int argc, char** argv) { // ... let's assume we fetch data from network... - ocl::io::println("Testing data..."); + scl::io::println("Testing data..."); auto opt = do_some("Ohio", "Ohio"); opt.try_or_throw("Checksum failed, Ohio isn't Ohio!"); diff --git a/dev/examples/tracked_ptr/tracked_ptr.cc b/dev/examples/tracked_ptr/tracked_ptr.cc index 6e3f4a2..6b8a859 100644 --- a/dev/examples/tracked_ptr/tracked_ptr.cc +++ b/dev/examples/tracked_ptr/tracked_ptr.cc @@ -9,13 +9,13 @@ static void summon_tracked_ptr() { - ocl::memory::tracked_ptr<int> ptr = ocl::memory::make_tracked<int>(42); + scl::memory::tracked_ptr<int> ptr = scl::memory::make_tracked<int>(42); std::cout << ptr.data() << "=" << ptr.manager().allocator().allocated_count_ << std::endl; } static void summon_leak_tracked_ptr() { - ocl::memory::tracked_ptr<int>* ptr = new ocl::memory::tracked_ptr<int>(42); + scl::memory::tracked_ptr<int>* ptr = new scl::memory::tracked_ptr<int>(42); std::cout << ptr->data() << "=" << ptr->manager().allocator().allocated_count_ << std::endl; } @@ -27,7 +27,7 @@ int main(int argc, char** argv) summon_tracked_ptr(); summon_tracked_ptr(); - ocl::memory::tracked_ptr<int> ptr; + scl::memory::tracked_ptr<int> ptr; std::cout << ptr.data() << "=" << ptr.manager().allocator().allocated_count_ << std::endl; @@ -46,7 +46,7 @@ int main(int argc, char** argv) std::cout << "total=" << ptr.manager().allocator().deallocated_count_ << std::endl; std::cout << "leak-detected=" << std::boolalpha << (ptr.manager().allocator().allocated_count_ > ptr.manager().allocator().deallocated_count_) << std::endl; - ocl::memory::must_pass(ptr); + scl::memory::must_pass(ptr); return EXIT_SUCCESS; } diff --git a/dev/lib/core/allocator_system.hpp b/dev/lib/core/allocator_system.hpp index 1243ed5..53cf095 100644 --- a/dev/lib/core/allocator_system.hpp +++ b/dev/lib/core/allocator_system.hpp @@ -5,14 +5,14 @@ * Copyright 2025, Amlal El Mahrouss. Licensed under the BSL 1.0 license */ -#ifndef _OCL_ALLOCATOR_SYSTEM_HPP -#define _OCL_ALLOCATOR_SYSTEM_HPP +#ifndef _SCL_ALLOCATOR_SYSTEM_HPP +#define _SCL_ALLOCATOR_SYSTEM_HPP #include <lib/core/includes.hpp> #include <stdexcept> #include <memory> -namespace ocl +namespace scl { template <typename type> struct new_op final @@ -70,6 +70,6 @@ namespace ocl template <typename type> using standard_allocator_type = allocator_system<type, new_op<type>, delete_op<type>>; -} // namespace ocl +} // namespace scl -#endif // ifndef _OCL_ALLOCATOR_SYSTEM_HPP +#endif // ifndef _SCL_ALLOCATOR_SYSTEM_HPP diff --git a/dev/lib/core/error_handler.hpp b/dev/lib/core/error_handler.hpp index 1a1515d..939a0ff 100644 --- a/dev/lib/core/error_handler.hpp +++ b/dev/lib/core/error_handler.hpp @@ -5,14 +5,14 @@ * Copyright 2025, Amlal El Mahrouss. */ -#ifndef _OCL_ERROR_HANDLER_HPP -#define _OCL_ERROR_HANDLER_HPP +#ifndef _SCL_ERROR_HANDLER_HPP +#define _SCL_ERROR_HANDLER_HPP #include <lib/core/includes.hpp> #include <lib/io/print.hpp> #include <stdexcept> -namespace ocl +namespace scl { struct basic_error_handler; @@ -26,12 +26,12 @@ namespace ocl virtual void operator()(const std::basic_string<char>& msg) { - ocl::io::print(msg); + scl::io::print(msg); } }; using standard_error_handler = basic_error_handler; using error_handler_type = basic_error_handler; -} // namespace ocl +} // namespace scl -#endif // ifndef _OCL_ERROR_HANDLER_HPP +#endif // ifndef _SCL_ERROR_HANDLER_HPP diff --git a/dev/lib/except/error.hpp b/dev/lib/except/error.hpp index 16bf5eb..31b9894 100644 --- a/dev/lib/except/error.hpp +++ b/dev/lib/except/error.hpp @@ -4,17 +4,17 @@ * Copyright 2023-2025, Amlal El Mahrouss */ -#ifndef _OCL_ERR_HPP -#define _OCL_ERR_HPP +#ifndef _SCL_ERR_HPP +#define _SCL_ERR_HPP #include <stdexcept> -namespace ocl +namespace scl { using runtime_error = std::runtime_error; using fix_error = runtime_error; using math_error = runtime_error; using cgi_error = runtime_error; -} // namespace ocl +} // namespace scl -#endif // _OCL_ERR_HPP
\ No newline at end of file +#endif // _SCL_ERR_HPP
\ No newline at end of file diff --git a/dev/lib/fix/fix.hpp b/dev/lib/fix/fix.hpp index 723506e..4a5a3ae 100644 --- a/dev/lib/fix/fix.hpp +++ b/dev/lib/fix/fix.hpp @@ -5,8 +5,8 @@ * Copyright 2025, Amlal El Mahrouss */ -#ifndef _OCL_FIX_PARSER_HPP -#define _OCL_FIX_PARSER_HPP +#ifndef _SCL_FIX_PARSER_HPP +#define _SCL_FIX_PARSER_HPP #include <cstddef> #include <cassert> @@ -18,7 +18,7 @@ #include <unistd.h> #include <signal.h> -namespace ocl::fix +namespace scl::fix { template <typename char_type> class basic_visitor; @@ -211,6 +211,6 @@ namespace ocl::fix } using fix_tag_type = std::uint32_t; -} // namespace ocl::fix +} // namespace scl::fix -#endif // ifndef _OCL_FIX_PARSER_HPP +#endif // ifndef _SCL_FIX_PARSER_HPP diff --git a/dev/lib/io/print.hpp b/dev/lib/io/print.hpp index 307c06f..8463b6f 100644 --- a/dev/lib/io/print.hpp +++ b/dev/lib/io/print.hpp @@ -5,13 +5,13 @@ * Copyright 2025 */ -#ifndef _OCL_PRINT_HPP -#define _OCL_PRINT_HPP +#ifndef _SCL_PRINT_HPP +#define _SCL_PRINT_HPP #include <iostream> #include <ostream> -namespace ocl::io +namespace scl::io { template <typename T, typename... Args> inline void print(T fmt, Args... other) noexcept @@ -37,6 +37,6 @@ namespace ocl::io print(fmt...); print(); } -} // namespace ocl::io +} // namespace scl::io -#endif // ifndef _OCL_PRINT_HPP +#endif // ifndef _SCL_PRINT_HPP diff --git a/dev/lib/logic/equiv.hpp b/dev/lib/logic/equiv.hpp index 5b022f8..05d0f53 100644 --- a/dev/lib/logic/equiv.hpp +++ b/dev/lib/logic/equiv.hpp @@ -8,7 +8,7 @@ #pragma once /// @brief OCL equivalence namespace. -namespace ocl::equiv +namespace scl::equiv { template <typename T> struct basic_hash_trait @@ -101,4 +101,4 @@ namespace ocl::equiv return left_ / right_ == 1; } }; -} // namespace ocl::equiv +} // namespace scl::equiv diff --git a/dev/lib/logic/math.hpp b/dev/lib/logic/math.hpp index e796eae..2d00595 100644 --- a/dev/lib/logic/math.hpp +++ b/dev/lib/logic/math.hpp @@ -9,7 +9,7 @@ #include <cmath> -namespace ocl +namespace scl { template <std::size_t T> struct is_non_boolean_integer final @@ -32,4 +32,4 @@ namespace ocl constexpr inline auto not_a_number = NAN; constexpr inline auto positive_infinity = INFINITY; constexpr inline auto negative_infinity = -positive_infinity; -} // namespace ocl
\ No newline at end of file +} // namespace scl
\ No newline at end of file diff --git a/dev/lib/logic/opt.hpp b/dev/lib/logic/opt.hpp index 137460c..4ce999c 100644 --- a/dev/lib/logic/opt.hpp +++ b/dev/lib/logic/opt.hpp @@ -4,13 +4,13 @@ * Copyright 2023-2025, Amlal El Mahrouss */ -#ifndef _OCL_OPT_HPP -#define _OCL_OPT_HPP +#ifndef _SCL_OPT_HPP +#define _SCL_OPT_HPP #include <lib/except/error.hpp> #include <utility> -namespace ocl +namespace scl { enum class return_type { @@ -129,6 +129,6 @@ namespace ocl { return return_type::err; } -} // namespace ocl +} // namespace scl -#endif /* ifndef _OCL_OPT_HPP */ +#endif /* ifndef _SCL_OPT_HPP */ diff --git a/dev/lib/memory/tracked_ptr.hpp b/dev/lib/memory/tracked_ptr.hpp index d2f8450..eb33bd0 100644 --- a/dev/lib/memory/tracked_ptr.hpp +++ b/dev/lib/memory/tracked_ptr.hpp @@ -16,7 +16,7 @@ #include <unistd.h> #include <signal.h> -namespace ocl::memory +namespace scl::memory { template <typename T> class tracked_allocator; @@ -232,4 +232,4 @@ namespace ocl::memory ::kill(::getpid(), SIGTRAP); } } -} // namespace ocl::memory +} // namespace scl::memory diff --git a/dev/lib/net/modem.hpp b/dev/lib/net/modem.hpp index 074f182..69b1aef 100644 --- a/dev/lib/net/modem.hpp +++ b/dev/lib/net/modem.hpp @@ -5,19 +5,18 @@ * Copyright 2025, Amlal El Mahrouss */ -#ifndef _OCL_NET_NETWORK_HPP -#define _OCL_NET_NETWORK_HPP +#ifndef _SCL_NET_NETWORK_HPP +#define _SCL_NET_NETWORK_HPP #include <unistd.h> #include <arpa/inet.h> #include <sys/socket.h> #include <string> -#include <utility> #include <cstddef> -#define OCL_MODEM_INTERFACE : public ocl::net::basic_modem +#define OCL_MODEM_INTERFACE : public scl::net::basic_modem -namespace ocl::net +namespace scl::net { class basic_modem; @@ -130,12 +129,13 @@ namespace ocl::net return ret == 0L; } - ::bind(fd_, (struct sockaddr*)&addr_, sizeof(addr_)); - ::listen(fd_, basic_modem::backlog_count); + int ret = ::bind(fd_, (struct sockaddr*)&addr_, sizeof(addr_)); - bad_ = false; + bad_ = ret == -1; + + ::listen(fd_, basic_modem::backlog_count); - return true; + return bad_ == false; } bool destroy() noexcept @@ -151,6 +151,6 @@ namespace ocl::net return true; } }; -} // namespace ocl::net +} // namespace scl::net -#endif // ifndef _OCL_NET_NETWORK_HPP +#endif // ifndef _SCL_NET_NETWORK_HPP diff --git a/dev/lib/net/url.hpp b/dev/lib/net/url.hpp index 7263a52..3ada418 100644 --- a/dev/lib/net/url.hpp +++ b/dev/lib/net/url.hpp @@ -13,7 +13,7 @@ /// @author Amlal El Mahrouss (amlal@nekernel.org) -namespace ocl::net +namespace scl::net { template <typename char_type> class basic_url; @@ -69,4 +69,4 @@ namespace ocl::net mailto, bad }; -} // namespace ocl::net +} // namespace scl::net diff --git a/dev/lib/simd/basic_simd.hpp b/dev/lib/simd/basic_simd.hpp index d748d0c..97d0399 100644 --- a/dev/lib/simd/basic_simd.hpp +++ b/dev/lib/simd/basic_simd.hpp @@ -22,7 +22,7 @@ using simd_type = __m256; using simd_type = float32x4_t; #endif -namespace ocl::snu::simd +namespace scl::snu::simd { struct basic_simd_backend final { @@ -47,4 +47,4 @@ namespace ocl::snu::simd return "basic-backend"; } }; -} // namespace ocl::snu::simd +} // namespace scl::snu::simd diff --git a/dev/lib/simd/simd.hpp b/dev/lib/simd/simd.hpp index 779d020..3cb4d7a 100644 --- a/dev/lib/simd/simd.hpp +++ b/dev/lib/simd/simd.hpp @@ -12,7 +12,7 @@ /// @author Amlal El Mahrouss /// @brief Basic SIMD processor. -namespace ocl::snu::simd +namespace scl::snu::simd { template <typename backend_type> class basic_simd_processor @@ -57,4 +57,4 @@ namespace ocl::snu::simd return processor_.isa(); } }; -} // namespace ocl::snu::simd +} // namespace scl::snu::simd diff --git a/dev/lib/tests/hpptest.hpp b/dev/lib/tests/hpptest.hpp index f520339..87d8f77 100644 --- a/dev/lib/tests/hpptest.hpp +++ b/dev/lib/tests/hpptest.hpp @@ -8,7 +8,7 @@ #pragma once #ifdef OCL_HPPTEST -namespace ocl::hpptest +namespace scl::hpptest { typedef bool condition_type; @@ -17,5 +17,5 @@ namespace ocl::hpptest { OCL_HPPTEST_ASSERT(expr); } -} // namespace ocl::hpptest +} // namespace scl::hpptest #endif diff --git a/dev/lib/utility/cgi_writer.hpp b/dev/lib/utility/cgi_writer.hpp index 126b299..87354ac 100644 --- a/dev/lib/utility/cgi_writer.hpp +++ b/dev/lib/utility/cgi_writer.hpp @@ -4,15 +4,15 @@ * Copyright 2023-2025, Amlal El Mahrouss. */ -#ifndef _OCL_CGI_WRITER_HPP -#define _OCL_CGI_WRITER_HPP +#ifndef _SCL_CGI_WRITER_HPP +#define _SCL_CGI_WRITER_HPP #include <lib/io/print.hpp> #include <lib/utility/chunk_string.hpp> #include <sstream> #include <format> -namespace ocl +namespace scl { namespace cgi { @@ -21,7 +21,7 @@ namespace ocl class basic_writer { private: - basic_writer& eval_(const ocl::basic_chunk_string<char_type>& mime, const ocl::basic_chunk_string<char_type>& ss) noexcept + basic_writer& eval_(const scl::basic_chunk_string<char_type>& mime, const scl::basic_chunk_string<char_type>& ss) noexcept { std::basic_stringstream<char_type> ss_out; @@ -30,50 +30,50 @@ namespace ocl ss_out << std::format("Content-Length: {}\r\n\r\n", ss.str().size()); ss_out << ss.str(); - ocl::io::print(ss_out.str()); + scl::io::print(ss_out.str()); return *this; } public: explicit basic_writer() = default; - ~basic_writer() = default; + virtual ~basic_writer() = default; basic_writer& operator=(const basic_writer&) = default; basic_writer(const basic_writer&) = default; public: - friend void operator<<(basic_writer& self, const ocl::basic_chunk_string<char_type>& ss_in) + friend void operator<<(basic_writer& self, const scl::basic_chunk_string<char_type>& ss_in) { self = self.eval_("text/plain", ss_in); } - basic_writer& binary(const ocl::basic_chunk_string<char_type>& ss_in) + basic_writer& binary(const scl::basic_chunk_string<char_type>& ss_in) { return this->eval_("application/octet-stream", ss_in); } - basic_writer& html(const ocl::basic_chunk_string<char_type>& ss_in) + basic_writer& html(const scl::basic_chunk_string<char_type>& ss_in) { return this->eval_("text/html", ss_in); } - basic_writer& xml(const ocl::basic_chunk_string<char_type>& ss_in) + basic_writer& xml(const scl::basic_chunk_string<char_type>& ss_in) { return this->eval_("application/xml", ss_in); } - basic_writer& json(const ocl::basic_chunk_string<char_type>& ss_in) + basic_writer& json(const scl::basic_chunk_string<char_type>& ss_in) { return this->eval_("application/json", ss_in); } - basic_writer& js(const ocl::basic_chunk_string<char_type>& ss_in) + basic_writer& js(const scl::basic_chunk_string<char_type>& ss_in) { return this->eval_("text/javascript", ss_in); } }; } // namespace cgi -} // namespace ocl +} // namespace scl -#endif // ifndef _OCL_CGI_WRITER_HPP +#endif // ifndef _SCL_CGI_WRITER_HPP diff --git a/dev/lib/utility/chunk_string.hpp b/dev/lib/utility/chunk_string.hpp index 4fe5cc2..c5bf5c6 100644 --- a/dev/lib/utility/chunk_string.hpp +++ b/dev/lib/utility/chunk_string.hpp @@ -10,7 +10,7 @@ #include <lib/core/includes.hpp> -namespace ocl +namespace scl { template <typename char_type, std::size_t max_chunk_size = 8196> class basic_chunk_string; @@ -89,7 +89,7 @@ namespace ocl void print() noexcept { - ocl::io::print(packed_chunks_); + scl::io::print(packed_chunks_); } }; @@ -98,5 +98,5 @@ namespace ocl { fmt.print(); } -} // namespace ocl +} // namespace scl #endif // ifndef OCL_UTILITY_CHUNK_STRING_HPP diff --git a/dev/lib/utility/crc32.hpp b/dev/lib/utility/crc32.hpp index ea09b94..93347a8 100644 --- a/dev/lib/utility/crc32.hpp +++ b/dev/lib/utility/crc32.hpp @@ -5,8 +5,8 @@ * Copyright 2025, Amlal El Mahrouss. */ -#ifndef _OCL_CRC32_HPP -#define _OCL_CRC32_HPP +#ifndef _SCL_CRC32_HPP +#define _SCL_CRC32_HPP #include <cstdint> #include <string> @@ -15,7 +15,7 @@ /// @brief Crc32 implementation in C++ /// @author Amlal EL Mahrouss (amlal@nekernel.org) -namespace ocl::crc32 +namespace scl::crc32 { namespace detail { @@ -76,6 +76,6 @@ namespace ocl::crc32 { return detail::crc32(in.c_str(), in.size()); } -} // namespace ocl::crc32 +} // namespace scl::crc32 -#endif // !_OCL_CRC32_HPP
\ No newline at end of file +#endif // !_SCL_CRC32_HPP
\ No newline at end of file diff --git a/dev/lib/utility/embfs.hpp b/dev/lib/utility/embfs.hpp index 0f20596..689082c 100644 --- a/dev/lib/utility/embfs.hpp +++ b/dev/lib/utility/embfs.hpp @@ -5,8 +5,8 @@ * Copyright 2025, Amlal El Mahrouss. */ -#ifndef _OCL_EMBFS_HPP -#define _OCL_EMBFS_HPP +#ifndef _SCL_EMBFS_HPP +#define _SCL_EMBFS_HPP #include <cstdint> #include <cstddef> @@ -14,7 +14,7 @@ /// @brief A filesystem designed for tiny storage medias. /// @author Amlal EL Mahrouss (amlal@nekernel.org) -namespace ocl::embfs +namespace scl::embfs { namespace traits { @@ -75,6 +75,6 @@ namespace ocl::embfs /// @brief Indexed node linear array. typedef embfs_inode embfs_inode_arr_t[_inode_arr_len]; } // namespace traits -} // namespace ocl::embfs +} // namespace scl::embfs -#endif // ifndef _OCL_EMBFS_HPP
\ No newline at end of file +#endif // ifndef _SCL_EMBFS_HPP
\ No newline at end of file diff --git a/dev/tests/chunk_string/chunk_test.cc b/dev/tests/chunk_string/chunk_test.cc index ad3d31b..b24b332 100644 --- a/dev/tests/chunk_string/chunk_test.cc +++ b/dev/tests/chunk_string/chunk_test.cc @@ -16,7 +16,7 @@ TEST(ChunkTest, BasicChunkUsage) auto start = std::chrono::high_resolution_clock::now(); - ocl::basic_chunk_string<char, 1000000> optimized; + scl::basic_chunk_string<char, 1000000> optimized; for (unsigned i = 0; i < iterations; ++i) { diff --git a/dev/tests/fix_basic/fix_test.cc b/dev/tests/fix_basic/fix_test.cc index 1c80716..5457f21 100644 --- a/dev/tests/fix_basic/fix_test.cc +++ b/dev/tests/fix_basic/fix_test.cc @@ -10,9 +10,9 @@ TEST(FIXTest, BasicFIXUsage) { - ocl::fix::basic_visitor<char> basic_visitor; - ocl::fix::basic_range_data<char> fix = basic_visitor.visit("8=FIX.4.2|9=65|35=A|49=SERVER|56=CLIENT|34=177|52=20090107-18:15:16|98=0|108=30|10=062|"); + scl::fix::basic_visitor<char> basic_visitor; + scl::fix::basic_range_data<char> fix = basic_visitor.visit("8=FIX.4.2|9=65|35=A|49=SERVER|56=CLIENT|34=177|52=20090107-18:15:16|98=0|108=30|10=062|"); - EXPECT_EQ(fix.magic_, ocl::fix::detail::begin_fix()); + EXPECT_EQ(fix.magic_, scl::fix::detail::begin_fix()); EXPECT_TRUE(fix.is_valid()); } diff --git a/dev/tests/network_basic/net_test.cc b/dev/tests/network_basic/net_test.cc index 61d0b28..4bd3a9f 100644 --- a/dev/tests/network_basic/net_test.cc +++ b/dev/tests/network_basic/net_test.cc @@ -12,8 +12,8 @@ TEST(NetworkTest, BasicNetworkUsage) { - ocl::net::basic_modem modem; - modem.construct<AF_INET, SOCK_STREAM, 8000>(ocl::net::basic_modem::local_address_ip4, true); + scl::net::basic_modem modem; + modem.construct<AF_INET, SOCK_STREAM, 8000>(scl::net::basic_modem::local_address_ip4, true); EXPECT_TRUE(modem.is_valid()); diff --git a/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc b/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc index 1e97188..decae88 100644 --- a/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc +++ b/dev/tests/tracked_ptr_basic/tracked_ptr_test.cc @@ -10,16 +10,16 @@ TEST(TrackedPtrTest, BasicTrackedPtrUsage) { - ocl::memory::tracked_ptr<int> ptr = ocl::memory::make_tracked<int>(42); + scl::memory::tracked_ptr<int> ptr = scl::memory::make_tracked<int>(42); ASSERT_TRUE(ptr); EXPECT_EQ(*ptr, 42); - ocl::memory::tracked_ptr<int> ptr2; + scl::memory::tracked_ptr<int> ptr2; - ocl::memory::swap(ptr, ptr2); + scl::memory::swap(ptr, ptr2); ptr2.reset(); - EXPECT_EQ(ocl::memory::tracked_ptr<int>::manager().allocator().allocated_count_, 1); + EXPECT_EQ(scl::memory::tracked_ptr<int>::manager().allocator().allocated_count_, 1); }
\ No newline at end of file diff --git a/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc b/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc index f349f47..375fb35 100644 --- a/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc +++ b/dev/tests/tracked_ptr_leak/tracked_ptr_test.cc @@ -10,10 +10,10 @@ TEST(TrackedPtrTest, LeakTrackedPtrUsage) { - ocl::memory::tracked_ptr<int>* ptr = new ocl::memory::tracked_ptr<int>(42); - ocl::memory::tracked_ptr<int>* ptr2 = new ocl::memory::tracked_ptr<int>(42); - ocl::memory::tracked_ptr<int>* ptr3 = new ocl::memory::tracked_ptr<int>(42); + scl::memory::tracked_ptr<int>* ptr = new scl::memory::tracked_ptr<int>(42); + scl::memory::tracked_ptr<int>* ptr2 = new scl::memory::tracked_ptr<int>(42); + scl::memory::tracked_ptr<int>* ptr3 = new scl::memory::tracked_ptr<int>(42); - EXPECT_EQ(ocl::memory::tracked_ptr<int>::manager().allocator().allocated_count_, 3); - ASSERT_TRUE(ocl::memory::tracked_ptr<int>::manager().allocator().deallocated_count_ == 0); + EXPECT_EQ(scl::memory::tracked_ptr<int>::manager().allocator().allocated_count_, 3); + ASSERT_TRUE(scl::memory::tracked_ptr<int>::manager().allocator().deallocated_count_ == 0); }
\ No newline at end of file diff --git a/meta/tex/embfs.tex b/meta/tex/embfs.tex index 2d5c60e..1548ab8 100644 --- a/meta/tex/embfs.tex +++ b/meta/tex/embfs.tex @@ -37,7 +37,7 @@ The \textbf{Embedded File System (EMBFS)} is a compact and minimal filesystem de \section{Namespace} The EMBFS implementation resides under: \begin{lstlisting} -namespace ocl::embfs +namespace scl::embfs \end{lstlisting} \section{Supported Logical Block Addressing (LBA) Modes} |
