Added resetting and trim to the entries
This commit is contained in:
32
src/entry.c
32
src/entry.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user