Update to use Auxid
Some checks failed
CI / build-linux-and-wasm (x64-linux) (push) Has been cancelled
Some checks failed
CI / build-linux-and-wasm (x64-linux) (push) Has been cancelled
This commit is contained in:
@ -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
|
||||
|
||||
@ -86,11 +86,11 @@ auto IpcNode::connect(Const<const char *> connection_string) -> Result<void> {
|
||||
Ref<IpcConnectionDescriptor> 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<u8 *> mapped_ptr = OX_TRY(FileOps::map_shared_memory(
|
||||
Mut<u8 *> 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<const char *> connection_string) -> Result<void> {
|
||||
Mut<u8 *> moni_ptr = m_shared_memory + layout->moni_data_offset;
|
||||
Mut<u8 *> 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<u8>(moni_ptr, static_cast<usize>(layout->moni_data_size)), false));
|
||||
|
||||
m_mino = OX_TRY(RingBufferView::create(
|
||||
m_mino = AU_TRY(RingBufferView::create(
|
||||
&layout->mino_control,
|
||||
Span<u8>(mino_ptr, static_cast<usize>(layout->mino_data_size)), false));
|
||||
|
||||
@ -304,10 +304,10 @@ auto IpcManager::spawn_node(Ref<Path> 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<u_long> mode = 1;
|
||||
@ -318,7 +318,7 @@ auto IpcManager::spawn_node(Ref<Path> executable_path,
|
||||
|
||||
Const<String> 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<IpcSharedMemoryLayout *> layout =
|
||||
reinterpret_cast<IpcSharedMemoryLayout *>(session->mapped_ptr);
|
||||
@ -339,13 +339,13 @@ auto IpcManager::spawn_node(Ref<Path> 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<u8>(session->mapped_ptr + layout->moni_data_offset,
|
||||
static_cast<usize>(layout->moni_data_size)),
|
||||
true));
|
||||
|
||||
session->mino = OX_TRY(RingBufferView::create(
|
||||
session->mino = AU_TRY(RingBufferView::create(
|
||||
&layout->mino_control,
|
||||
Span<u8>(session->mapped_ptr + layout->mino_data_offset,
|
||||
static_cast<usize>(layout->mino_data_size)),
|
||||
@ -358,7 +358,7 @@ auto IpcManager::spawn_node(Ref<Path> executable_path,
|
||||
|
||||
Const<String> 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<StringView> line) {
|
||||
if (Env::IS_DEBUG) {
|
||||
|
||||
@ -196,10 +196,10 @@ auto ProcessOps::spawn_process_windows(
|
||||
|
||||
return static_cast<i32>(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
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ namespace IACore {
|
||||
auto StreamReader::create_from_file(Ref<Path> path) -> Result<StreamReader> {
|
||||
Mut<usize> size = 0;
|
||||
|
||||
Const<const u8 *> ptr = OX_TRY(FileOps::map_file(path, size));
|
||||
Const<const u8 *> ptr = AU_TRY(FileOps::map_file(path, size));
|
||||
|
||||
Mut<StreamReader> reader(Span<const u8>(ptr, size));
|
||||
reader.m_storage_type = StorageType::OwningMmap;
|
||||
|
||||
@ -107,7 +107,7 @@ public:
|
||||
template <typename FuncT>
|
||||
IA_NODISCARD auto get_function(Ref<String> name) const -> Result<FuncT> {
|
||||
Mut<void *> sym = nullptr;
|
||||
sym = OX_TRY(get_symbol(name));
|
||||
sym = AU_TRY(get_symbol(name));
|
||||
return reinterpret_cast<FuncT>(sym);
|
||||
}
|
||||
|
||||
|
||||
@ -22,11 +22,11 @@
|
||||
|
||||
#if IA_PLATFORM_WINDOWS
|
||||
using NativeFileHandle = HANDLE;
|
||||
static constexpr ox::Const<NativeFileHandle> INVALID_FILE_HANDLE =
|
||||
static constexpr au::Const<NativeFileHandle> INVALID_FILE_HANDLE =
|
||||
INVALID_HANDLE_VALUE;
|
||||
#else
|
||||
using NativeFileHandle = int;
|
||||
static constexpr ox::Const<NativeFileHandle> INVALID_FILE_HANDLE = -1;
|
||||
static constexpr au::Const<NativeFileHandle> INVALID_FILE_HANDLE = -1;
|
||||
#endif
|
||||
|
||||
namespace IACore {
|
||||
|
||||
@ -69,7 +69,7 @@ template <typename ResponseType>
|
||||
auto HttpClient::json_get(Ref<String> path, Span<Const<Header>> headers)
|
||||
-> Result<ResponseType> {
|
||||
Const<String> 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<String> path, Span<Const<Header>> headers)
|
||||
template <typename PayloadType, typename ResponseType>
|
||||
auto HttpClient::json_post(Ref<String> path, Span<Const<Header>> headers,
|
||||
Ref<PayloadType> body) -> Result<ResponseType> {
|
||||
Const<String> encoded_body = OX_TRY(Json::encode_struct(body));
|
||||
Const<String> encoded_body = AU_TRY(Json::encode_struct(body));
|
||||
|
||||
Const<String> 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 {}",
|
||||
|
||||
@ -68,18 +68,18 @@
|
||||
|
||||
#include <ankerl/unordered_dense.h>
|
||||
|
||||
#include <oxide/oxide.hpp>
|
||||
#include <auxid/auxid.hpp>
|
||||
|
||||
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<bool> IS_WINDOWS = true;
|
||||
|
||||
Reference in New Issue
Block a user