[FL-2415] Storage: blocking file open (#1078)

* Storage: correct replacement for "/any" path in path holder
* Unit tests: storage, blocking file open test
* File stream: error getter
* Storage: common copy and common remove now executes in external thread
* Filesystems: got rid of unused functions
* Storage: untangle dependencies, ram-frendly filesystem api
* iButton: context assertions
* Storage: pubsub messages
* Storage: wait for the file to close if it was open
* Storage: fix folder copying
* Storage: unit test
* Storage: pubsub documentation
* Fix merge error
* Fix memleak in storage test
* Storage: remove unused define

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
SG
2022-04-01 22:21:31 +10:00
committed by GitHub
parent cb7d43f7e1
commit 855f2584ab
37 changed files with 443 additions and 281 deletions
+2 -24
View File
@@ -103,25 +103,7 @@ bool storage_has_file(const File* file, StorageData* storage_data) {
return result;
}
StorageType storage_get_type_by_path(const char* path) {
StorageType type = ST_ERROR;
const char* ext_path = "/ext";
const char* int_path = "/int";
const char* any_path = "/any";
if(strlen(path) >= strlen(ext_path) && memcmp(path, ext_path, strlen(ext_path)) == 0) {
type = ST_EXT;
} else if(strlen(path) >= strlen(int_path) && memcmp(path, int_path, strlen(int_path)) == 0) {
type = ST_INT;
} else if(strlen(path) >= strlen(any_path) && memcmp(path, any_path, strlen(any_path)) == 0) {
type = ST_ANY;
}
return type;
}
bool storage_path_already_open(const char* path, StorageFileList_t array) {
bool storage_path_already_open(string_t path, StorageFileList_t array) {
bool open = false;
StorageFileList_it_t it;
@@ -178,11 +160,7 @@ void* storage_get_storage_file_data(const File* file, StorageData* storage) {
return founded_file->file_data;
}
void storage_push_storage_file(
File* file,
const char* path,
StorageType type,
StorageData* storage) {
void storage_push_storage_file(File* file, string_t path, StorageType type, StorageData* storage) {
StorageFile* storage_file = StorageFileList_push_new(storage->files);
furi_check(storage_file != NULL);