diff --git a/CMake/FindDeps.cmake b/CMake/FindDeps.cmake index a4d20c7..3ae114f 100644 --- a/CMake/FindDeps.cmake +++ b/CMake/FindDeps.cmake @@ -15,8 +15,8 @@ set(ZLIB_ENABLE_TESTS OFF CACHE BOOL "" FORCE) set(WITH_GZFILEOP ON CACHE BOOL "" FORCE) FetchContent_Declare( - Oxide - GIT_REPOSITORY https://github.com/I-A-S/Oxide + Auxid + GIT_REPOSITORY https://github.com/I-A-S/Auxid GIT_TAG main OVERRIDE_FIND_PACKAGE ) @@ -133,7 +133,7 @@ if(NOT TARGET zstd::libzstd) add_library(zstd::libzstd ALIAS libzstd_static) endif() -FetchContent_MakeAvailable(Oxide httplib pugixml nlohmann_json glaze simdjson unordered_dense mimalloc highway) +FetchContent_MakeAvailable(Auxid httplib pugixml nlohmann_json glaze simdjson unordered_dense mimalloc highway) if(NOT TARGET simdjson::simdjson) add_library(simdjson::simdjson ALIAS simdjson) diff --git a/README.md b/README.md index 9e1742a..e0c36de 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ IACore is a high-performance C++20 foundation library bundling essential systems (IPC, Logging, Networking, Compression, and Async Scheduling) into a single, coherent API. -IACore strictly follows the coding style and philosophy of [Oxide](https://github.com/I-A-S/Oxide). +IACore strictly follows the coding style and philosophy of [Auxid](https://github.com/I-A-S/Auxid). Originally developed as the internal core for IASoft (PVT) LTD., it is now open-source to provide a standardized bedrock for C++ applications where performance matters. @@ -43,12 +43,12 @@ IACore provides a manager/node architecture using shared memory. #include // Spawns a child process and connects via Shared Memory -auto nodeID = manager.spawn_node("MyChildNodeExe"); -manager.wait_till_node_is_online(*nodeID); +auto node_id = manager.spawn_node("MyChildNodeExe"); +manager.wait_till_node_is_online(*node_id); // Send data with zero-copy overhead String msg = "Hello Node"; -manager.send_packet(*nodeID, 100, {(PCUINT8)msg.data(), msg.size()}); +manager.send_packet(*node_id, 100, {(PCUINT8)msg.data(), msg.size()}); ``` #### Node: diff --git a/Src/IACore/CMakeLists.txt b/Src/IACore/CMakeLists.txt index 677c853..3a77c31 100644 --- a/Src/IACore/CMakeLists.txt +++ b/Src/IACore/CMakeLists.txt @@ -30,7 +30,7 @@ target_include_directories(IACore PRIVATE imp/hpp/) target_link_libraries(IACore PUBLIC hwy zlib - Oxide + Auxid zstd::libzstd glaze::glaze httplib::httplib diff --git a/Src/IACore/imp/cpp/IPC.cpp b/Src/IACore/imp/cpp/IPC.cpp index 203cdb9..89696c0 100644 --- a/Src/IACore/imp/cpp/IPC.cpp +++ b/Src/IACore/imp/cpp/IPC.cpp @@ -86,11 +86,11 @@ auto IpcNode::connect(Const connection_string) -> Result { Ref desc = *desc_opt; m_shm_name = desc.shared_mem_path; - m_socket = OX_TRY(SocketOps::create_unix_socket()); - OX_TRY_PURE( + m_socket = AU_TRY(SocketOps::create_unix_socket()); + AU_TRY_PURE( SocketOps::connect_unix_socket(m_socket, desc.socket_path.c_str())); - Mut mapped_ptr = OX_TRY(FileOps::map_shared_memory( + Mut mapped_ptr = AU_TRY(FileOps::map_shared_memory( desc.shared_mem_path, desc.shared_mem_size, false)); m_shared_memory = mapped_ptr; @@ -108,11 +108,11 @@ auto IpcNode::connect(Const connection_string) -> Result { Mut moni_ptr = m_shared_memory + layout->moni_data_offset; Mut mino_ptr = m_shared_memory + layout->mino_data_offset; - m_moni = OX_TRY(RingBufferView::create( + m_moni = AU_TRY(RingBufferView::create( &layout->moni_control, Span(moni_ptr, static_cast(layout->moni_data_size)), false)); - m_mino = OX_TRY(RingBufferView::create( + m_mino = AU_TRY(RingBufferView::create( &layout->mino_control, Span(mino_ptr, static_cast(layout->mino_data_size)), false)); @@ -304,10 +304,10 @@ auto IpcManager::spawn_node(Ref executable_path, sock_path = std::format("/tmp/ia_sess_{}.sock", sid); #endif - session->listener_socket = OX_TRY(SocketOps::create_unix_socket()); - OX_TRY_PURE( + session->listener_socket = AU_TRY(SocketOps::create_unix_socket()); + AU_TRY_PURE( SocketOps::bind_unix_socket(session->listener_socket, sock_path.c_str())); - OX_TRY_PURE(SocketOps::listen(session->listener_socket, 1)); + AU_TRY_PURE(SocketOps::listen(session->listener_socket, 1)); #if IA_PLATFORM_WINDOWS Mut mode = 1; @@ -318,7 +318,7 @@ auto IpcManager::spawn_node(Ref executable_path, Const shm_name = std::format("ia_shm_{}", sid); session->mapped_ptr = - OX_TRY(FileOps::map_shared_memory(shm_name, shared_memory_size, true)); + AU_TRY(FileOps::map_shared_memory(shm_name, shared_memory_size, true)); Mut layout = reinterpret_cast(session->mapped_ptr); @@ -339,13 +339,13 @@ auto IpcManager::spawn_node(Ref executable_path, layout->mino_data_offset = header_size + half_size; layout->mino_data_size = half_size; - session->moni = OX_TRY(RingBufferView::create( + session->moni = AU_TRY(RingBufferView::create( &layout->moni_control, Span(session->mapped_ptr + layout->moni_data_offset, static_cast(layout->moni_data_size)), true)); - session->mino = OX_TRY(RingBufferView::create( + session->mino = AU_TRY(RingBufferView::create( &layout->mino_control, Span(session->mapped_ptr + layout->mino_data_offset, static_cast(layout->mino_data_size)), @@ -358,7 +358,7 @@ auto IpcManager::spawn_node(Ref executable_path, Const args = std::format("\"{}\"", desc.serialize()); - session->node_process = OX_TRY(ProcessOps::spawn_process_async( + session->node_process = AU_TRY(ProcessOps::spawn_process_async( FileOps::normalize_executable_path(executable_path).string(), args, [sid](Const line) { if (Env::IS_DEBUG) { diff --git a/Src/IACore/imp/cpp/ProcessOps.cpp b/Src/IACore/imp/cpp/ProcessOps.cpp index 35a219c..db309e7 100644 --- a/Src/IACore/imp/cpp/ProcessOps.cpp +++ b/Src/IACore/imp/cpp/ProcessOps.cpp @@ -196,10 +196,10 @@ auto ProcessOps::spawn_process_windows( return static_cast(exit_code); #else - OX_UNUSED(command); - OX_UNUSED(args); - OX_UNUSED(on_output_line_callback); - OX_UNUSED(id); + AU_UNUSED(command); + AU_UNUSED(args); + AU_UNUSED(on_output_line_callback); + AU_UNUSED(id); return fail("Windows implementation not available."); #endif } @@ -298,10 +298,10 @@ auto ProcessOps::spawn_process_posix( return -1; } #else - OX_UNUSED(command); - OX_UNUSED(args); - OX_UNUSED(on_output_line_callback); - OX_UNUSED(id); + AU_UNUSED(command); + AU_UNUSED(args); + AU_UNUSED(on_output_line_callback); + AU_UNUSED(id); return fail("Posix implementation not available."); #endif } diff --git a/Src/IACore/imp/cpp/StreamReader.cpp b/Src/IACore/imp/cpp/StreamReader.cpp index 8dceb19..424a7f1 100644 --- a/Src/IACore/imp/cpp/StreamReader.cpp +++ b/Src/IACore/imp/cpp/StreamReader.cpp @@ -20,7 +20,7 @@ namespace IACore { auto StreamReader::create_from_file(Ref path) -> Result { Mut size = 0; - Const ptr = OX_TRY(FileOps::map_file(path, size)); + Const ptr = AU_TRY(FileOps::map_file(path, size)); Mut reader(Span(ptr, size)); reader.m_storage_type = StorageType::OwningMmap; diff --git a/Src/IACore/inc/IACore/DynamicLib.hpp b/Src/IACore/inc/IACore/DynamicLib.hpp index 12d4756..68b4e4a 100644 --- a/Src/IACore/inc/IACore/DynamicLib.hpp +++ b/Src/IACore/inc/IACore/DynamicLib.hpp @@ -107,7 +107,7 @@ public: template IA_NODISCARD auto get_function(Ref name) const -> Result { Mut sym = nullptr; - sym = OX_TRY(get_symbol(name)); + sym = AU_TRY(get_symbol(name)); return reinterpret_cast(sym); } diff --git a/Src/IACore/inc/IACore/FileOps.hpp b/Src/IACore/inc/IACore/FileOps.hpp index b6eec4e..63cad80 100644 --- a/Src/IACore/inc/IACore/FileOps.hpp +++ b/Src/IACore/inc/IACore/FileOps.hpp @@ -22,11 +22,11 @@ #if IA_PLATFORM_WINDOWS using NativeFileHandle = HANDLE; -static constexpr ox::Const INVALID_FILE_HANDLE = +static constexpr au::Const INVALID_FILE_HANDLE = INVALID_HANDLE_VALUE; #else using NativeFileHandle = int; -static constexpr ox::Const INVALID_FILE_HANDLE = -1; +static constexpr au::Const INVALID_FILE_HANDLE = -1; #endif namespace IACore { diff --git a/Src/IACore/inc/IACore/Http/Client.hpp b/Src/IACore/inc/IACore/Http/Client.hpp index c48fd6f..8ff3785 100644 --- a/Src/IACore/inc/IACore/Http/Client.hpp +++ b/Src/IACore/inc/IACore/Http/Client.hpp @@ -69,7 +69,7 @@ template auto HttpClient::json_get(Ref path, Span> headers) -> Result { Const raw_response = - OX_TRY(raw_get(path, headers, "application/json")); + AU_TRY(raw_get(path, headers, "application/json")); if (last_response_code() != EResponseCode::OK) { return fail("Server responded with code {}", @@ -81,10 +81,10 @@ auto HttpClient::json_get(Ref path, Span> headers) template auto HttpClient::json_post(Ref path, Span> headers, Ref body) -> Result { - Const encoded_body = OX_TRY(Json::encode_struct(body)); + Const encoded_body = AU_TRY(Json::encode_struct(body)); Const raw_response = - OX_TRY(raw_post(path, headers, encoded_body, "application/json")); + AU_TRY(raw_post(path, headers, encoded_body, "application/json")); if (last_response_code() != EResponseCode::OK) { return fail("Server responded with code {}", diff --git a/Src/IACore/inc/IACore/PCH.hpp b/Src/IACore/inc/IACore/PCH.hpp index 2af0af4..59500f6 100644 --- a/Src/IACore/inc/IACore/PCH.hpp +++ b/Src/IACore/inc/IACore/PCH.hpp @@ -68,18 +68,18 @@ #include -#include +#include namespace IACore { -using namespace Oxide; +using namespace Auxid; // ============================================================================= // Build Environment & Constants // ============================================================================= namespace Env { -using namespace Oxide::Env; +using namespace Auxid::Env; #if IA_PLATFORM_WINDOWS constexpr Const IS_WINDOWS = true; diff --git a/Tests/Unit/Main.cpp b/Tests/Unit/Main.cpp index 38eb0b9..e08f918 100644 --- a/Tests/Unit/Main.cpp +++ b/Tests/Unit/Main.cpp @@ -23,7 +23,7 @@ using namespace IACore; IACORE_MAIN() { (void)args; - OX_TRY_PURE(SocketOps::initialize()); + AU_TRY_PURE(SocketOps::initialize()); std::cout << console::GREEN