updated build system
This commit is contained in:
parent
239652be7c
commit
c08c9bc216
@ -25,6 +25,7 @@
|
|||||||
#include "types/repertory.hpp"
|
#include "types/repertory.hpp"
|
||||||
#include "utils/error_utils.hpp"
|
#include "utils/error_utils.hpp"
|
||||||
#include "utils/timeout.hpp"
|
#include "utils/timeout.hpp"
|
||||||
|
#include "version.hpp"
|
||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
@ -116,8 +117,8 @@ void packet_client::put_client(std::shared_ptr<client> &cli) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto packet_client::read_packet(client &cli, packet &response)
|
auto packet_client::read_packet(client &cli,
|
||||||
-> packet::error_type {
|
packet &response) -> packet::error_type {
|
||||||
data_buffer buffer(sizeof(std::uint32_t));
|
data_buffer buffer(sizeof(std::uint32_t));
|
||||||
const auto read_buffer = [&]() {
|
const auto read_buffer = [&]() {
|
||||||
std::uint32_t offset{};
|
std::uint32_t offset{};
|
||||||
@ -168,8 +169,8 @@ auto packet_client::send(const std::string &method, packet &request,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto packet_client::send(const std::string &method, packet &request,
|
auto packet_client::send(const std::string &method, packet &request,
|
||||||
packet &response, std::uint32_t &service_flags)
|
packet &response,
|
||||||
-> packet::error_type {
|
std::uint32_t &service_flags) -> packet::error_type {
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
auto success = false;
|
auto success = false;
|
||||||
@ -178,7 +179,7 @@ auto packet_client::send(const std::string &method, packet &request,
|
|||||||
request.encode_top(utils::get_thread_id());
|
request.encode_top(utils::get_thread_id());
|
||||||
request.encode_top(unique_id_);
|
request.encode_top(unique_id_);
|
||||||
request.encode_top(PACKET_SERVICE_FLAGS);
|
request.encode_top(PACKET_SERVICE_FLAGS);
|
||||||
request.encode_top(get_repertory_version());
|
request.encode_top(project_get_version());
|
||||||
|
|
||||||
static const std::uint8_t max_attempts{5U};
|
static const std::uint8_t max_attempts{5U};
|
||||||
for (std::uint8_t i = 1U;
|
for (std::uint8_t i = 1U;
|
||||||
|
@ -52,8 +52,8 @@ remote_client::remote_client(const app_config &config)
|
|||||||
config.get_remote_receive_timeout_secs(),
|
config.get_remote_receive_timeout_secs(),
|
||||||
config.get_remote_send_timeout_secs(), config.get_remote_token()) {}
|
config.get_remote_send_timeout_secs(), config.get_remote_token()) {}
|
||||||
|
|
||||||
auto remote_client::winfsp_can_delete(PVOID file_desc, PWSTR file_name)
|
auto remote_client::winfsp_can_delete(PVOID file_desc,
|
||||||
-> packet::error_type {
|
PWSTR file_name) -> packet::error_type {
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -68,9 +68,8 @@ auto remote_client::winfsp_can_delete(PVOID file_desc, PWSTR file_name)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::json_create_directory_snapshot(const std::string &path,
|
auto remote_client::json_create_directory_snapshot(
|
||||||
json &json_data)
|
const std::string &path, json &json_data) -> packet::error_type {
|
||||||
-> packet::error_type {
|
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -111,8 +110,8 @@ auto remote_client::json_read_directory_snapshot(
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::json_release_directory_snapshot(
|
auto remote_client::json_release_directory_snapshot(
|
||||||
const std::string &path, const remote::file_handle &handle)
|
const std::string &path,
|
||||||
-> packet::error_type {
|
const remote::file_handle &handle) -> packet::error_type {
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -127,8 +126,8 @@ auto remote_client::json_release_directory_snapshot(
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::winfsp_cleanup(PVOID file_desc, PWSTR file_name,
|
auto remote_client::winfsp_cleanup(PVOID file_desc, PWSTR file_name,
|
||||||
UINT32 flags, BOOLEAN &was_closed)
|
UINT32 flags,
|
||||||
-> packet::error_type {
|
BOOLEAN &was_closed) -> packet::error_type {
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
auto handle = to_handle(file_desc);
|
auto handle = to_handle(file_desc);
|
||||||
@ -177,8 +176,8 @@ auto remote_client::winfsp_create(PWSTR file_name, UINT32 create_options,
|
|||||||
UINT32 granted_access, UINT32 attributes,
|
UINT32 granted_access, UINT32 attributes,
|
||||||
UINT64 allocation_size, PVOID *file_desc,
|
UINT64 allocation_size, PVOID *file_desc,
|
||||||
remote::file_info *file_info,
|
remote::file_info *file_info,
|
||||||
std::string &normalized_name, BOOLEAN &exists)
|
std::string &normalized_name,
|
||||||
-> packet::error_type {
|
BOOLEAN &exists) -> packet::error_type {
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -245,9 +244,8 @@ auto remote_client::winfsp_get_dir_buffer([[maybe_unused]] PVOID file_desc,
|
|||||||
return STATUS_INVALID_HANDLE;
|
return STATUS_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::winfsp_get_file_info(PVOID file_desc,
|
auto remote_client::winfsp_get_file_info(
|
||||||
remote::file_info *file_info)
|
PVOID file_desc, remote::file_info *file_info) -> packet::error_type {
|
||||||
-> packet::error_type {
|
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -264,11 +262,9 @@ auto remote_client::winfsp_get_file_info(PVOID file_desc,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::winfsp_get_security_by_name(PWSTR file_name,
|
auto remote_client::winfsp_get_security_by_name(
|
||||||
PUINT32 attributes,
|
PWSTR file_name, PUINT32 attributes, std::uint64_t *descriptor_size,
|
||||||
std::uint64_t *descriptor_size,
|
std::wstring &string_descriptor) -> packet::error_type {
|
||||||
std::wstring &string_descriptor)
|
|
||||||
-> packet::error_type {
|
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -297,10 +293,9 @@ auto remote_client::winfsp_get_security_by_name(PWSTR file_name,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::winfsp_get_volume_info(UINT64 &total_size,
|
auto remote_client::winfsp_get_volume_info(
|
||||||
UINT64 &free_size,
|
UINT64 &total_size, UINT64 &free_size,
|
||||||
std::string &volume_label)
|
std::string &volume_label) -> packet::error_type {
|
||||||
-> packet::error_type {
|
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -320,7 +315,7 @@ auto remote_client::winfsp_mounted(const std::wstring &location)
|
|||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
request.encode(get_repertory_version());
|
request.encode(project_get_version());
|
||||||
request.encode(location);
|
request.encode(location);
|
||||||
|
|
||||||
std::uint32_t service_flags{};
|
std::uint32_t service_flags{};
|
||||||
@ -332,11 +327,10 @@ auto remote_client::winfsp_mounted(const std::wstring &location)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::winfsp_open(PWSTR file_name, UINT32 create_options,
|
auto remote_client::winfsp_open(
|
||||||
UINT32 granted_access, PVOID *file_desc,
|
PWSTR file_name, UINT32 create_options, UINT32 granted_access,
|
||||||
remote::file_info *file_info,
|
PVOID *file_desc, remote::file_info *file_info,
|
||||||
std::string &normalized_name)
|
std::string &normalized_name) -> packet::error_type {
|
||||||
-> packet::error_type {
|
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -367,11 +361,10 @@ auto remote_client::winfsp_open(PWSTR file_name, UINT32 create_options,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::winfsp_overwrite(PVOID file_desc, UINT32 attributes,
|
auto remote_client::winfsp_overwrite(
|
||||||
BOOLEAN replace_attributes,
|
PVOID file_desc, UINT32 attributes, BOOLEAN replace_attributes,
|
||||||
UINT64 allocation_size,
|
UINT64 allocation_size,
|
||||||
remote::file_info *file_info)
|
remote::file_info *file_info) -> packet::error_type {
|
||||||
-> packet::error_type {
|
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -447,10 +440,9 @@ auto remote_client::winfsp_read_directory(PVOID file_desc, PWSTR pattern,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::winfsp_rename(PVOID file_desc, PWSTR file_name,
|
auto remote_client::winfsp_rename(
|
||||||
PWSTR new_file_name,
|
PVOID file_desc, PWSTR file_name, PWSTR new_file_name,
|
||||||
BOOLEAN replace_if_exists)
|
BOOLEAN replace_if_exists) -> packet::error_type {
|
||||||
-> packet::error_type {
|
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -494,10 +486,9 @@ auto remote_client::winfsp_set_basic_info(
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::winfsp_set_file_size(PVOID file_desc, UINT64 new_size,
|
auto remote_client::winfsp_set_file_size(
|
||||||
BOOLEAN set_allocation_size,
|
PVOID file_desc, UINT64 new_size, BOOLEAN set_allocation_size,
|
||||||
remote::file_info *file_info)
|
remote::file_info *file_info) -> packet::error_type {
|
||||||
-> packet::error_type {
|
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
@ -533,12 +524,10 @@ auto remote_client::winfsp_unmounted(const std::wstring &location)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto remote_client::winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset,
|
auto remote_client::winfsp_write(
|
||||||
UINT32 length, BOOLEAN write_to_end,
|
PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
|
||||||
BOOLEAN constrained_io,
|
BOOLEAN write_to_end, BOOLEAN constrained_io, PUINT32 bytes_transferred,
|
||||||
PUINT32 bytes_transferred,
|
remote::file_info *file_info) -> packet::error_type {
|
||||||
remote::file_info *file_info)
|
|
||||||
-> packet::error_type {
|
|
||||||
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
constexpr const auto *function_name = static_cast<const char *>(__FUNCTION__);
|
||||||
|
|
||||||
packet request;
|
packet request;
|
||||||
|
@ -22,12 +22,12 @@
|
|||||||
#ifndef INCLUDE_CLI_VERSION_HPP_
|
#ifndef INCLUDE_CLI_VERSION_HPP_
|
||||||
#define INCLUDE_CLI_VERSION_HPP_
|
#define INCLUDE_CLI_VERSION_HPP_
|
||||||
|
|
||||||
|
#include "version.hpp"
|
||||||
|
|
||||||
namespace repertory::cli::actions {
|
namespace repertory::cli::actions {
|
||||||
template <typename drive> inline void version(std::vector<const char *> args) {
|
template <typename drive> inline void version(std::vector<const char *> args) {
|
||||||
std::cout << "Repertory core version: " << get_repertory_version()
|
std::cout << "Repertory core version: " << project_get_version() << std::endl;
|
||||||
<< std::endl;
|
std::cout << "Repertory Git revision: " << project_get_git_rev() << std::endl;
|
||||||
std::cout << "Repertory Git revision: " << get_repertory_git_revision()
|
|
||||||
<< std::endl;
|
|
||||||
drive::display_version_information(args);
|
drive::display_version_information(args);
|
||||||
}
|
}
|
||||||
} // namespace repertory::cli::actions
|
} // namespace repertory::cli::actions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user