From ab244698c5998861d808c18e907cf8c4518d10ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexe=C3=AF=20KADIR?= Date: Sat, 17 Feb 2024 01:44:37 +0100 Subject: [PATCH] Added some more signatures to implement --- src/disk.c | 6 +++--- src/entry.h | 22 +++++++++++++++++++++- src/sandbox.c | 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/disk.c b/src/disk.c index 7a4b1b5..526fac2 100644 --- a/src/disk.c +++ b/src/disk.c @@ -131,9 +131,9 @@ Result rebase_disk(const char* path, const char* backing_disk) { Result get_disk_info(const char* path, DiskInfo* out_info) { // Initialize the output - out_info->backing_file = NULL; - out_info->actual_size = 0; - out_info->virtual_size = 0; + out_info->backing_file = NULL; + out_info->actual_size = 0; + out_info->virtual_size = 0; // Get the information about the disk int exit_code; diff --git a/src/entry.h b/src/entry.h index 0432f64..26de77d 100644 --- a/src/entry.h +++ b/src/entry.h @@ -28,4 +28,24 @@ Result entry_exists(const char* entry_id, bool* out_exists); /// @brief Adds an entry to the entry pool. /// @param entry_id The entry id. /// @return The result of the operation. -Result add_entry(const char* entry_id); \ No newline at end of file +Result add_entry(const char* entry_id); + +/// @brief Removes an entry from the entry pool. +/// @param entry_id The entry id. +/// @return The result of the operation. +Result remove_entry(const char* entry_id); + +/// @brief Lists the entries in the entry pool. +/// @param out_entries The pointer to the null-terminated output entries array. The caller is responsible for freeing the memory of the array and its elements. +/// @return The result of the operation. +Result list_entries(char*** out_entries); + +/// @brief Removes all the entries from the entry pool. +/// @return The result of the operation. +Result clear_entries(void); + +/// @brief Gets the path of the disk of the given entry. +/// @param entry_id The entry id. +/// @param out_path The pointer to the output path string. The caller is responsible for freeing the memory. +/// @return The result of the operation. +Result get_entry_disk_path(const char* entry_id, char** out_path); diff --git a/src/sandbox.c b/src/sandbox.c index d14136a..a5834b2 100644 --- a/src/sandbox.c +++ b/src/sandbox.c @@ -122,7 +122,7 @@ int command_add_entry(int argc, char* argv[]) { return result; // Add the disk to the entry - // TODO + // If this fails, remove the entry return EXIT_SUCCESS;