Started implementing backing managment
This commit is contained in:
21
src/entry.c
21
src/entry.c
@@ -304,6 +304,27 @@ Result list_entries(char*** out_entries) {
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
Result clear_entries(void) {
|
||||
char** entries;
|
||||
Result result = list_entries(&entries);
|
||||
if (result != SUCCESS)
|
||||
return result;
|
||||
|
||||
// Remove each entry
|
||||
for (int i = 0; entries[i] != NULL; i++) {
|
||||
result = remove_entry(entries[i]);
|
||||
if (result != SUCCESS)
|
||||
log_message(LOG_LEVEL_WARNING, "Failed to remove the entry '%s'.", entries[i]);
|
||||
}
|
||||
|
||||
// Free the entries
|
||||
for (int i = 0; entries[i] != NULL; i++)
|
||||
free(entries[i]);
|
||||
free(entries);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
Result reset_entry(const char* entry_id) {
|
||||
// Check that it exists
|
||||
bool exists;
|
||||
|
Reference in New Issue
Block a user