Added resetting and trim to the entries

This commit is contained in:
2024-02-17 02:46:21 +01:00
parent 799a362074
commit 5073ba3834
5 changed files with 80 additions and 9 deletions

View File

@@ -165,3 +165,35 @@ Result get_entry_disk_path(const char* entry_id, char** out_path) {
return result;
}
Result trim_entry_disk(const char* entry_id) {
// Get the disk path
char* disk_path;
Result result = get_entry_disk_path(entry_id, &disk_path);
if (result != SUCCESS)
return result;
// Trim the disk
result = trim_disk(disk_path);
// Free the disk path as it is no longer needed
free(disk_path);
return result;
}
Result reset_entry_disk(const char* entry_id) {
// Get the disk path
char* disk_path;
Result result = get_entry_disk_path(entry_id, &disk_path);
if (result != SUCCESS)
return result;
// Reset the disk
result = reset_disk(disk_path);
// Free the disk path as it is no longer needed
free(disk_path);
return result;
}