mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 13:28:36 -07:00
Move plugins to external folder
This commit is contained in:
21
applications/external/playlist/playlist_file.c
vendored
Normal file
21
applications/external/playlist/playlist_file.c
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <furi.h>
|
||||
|
||||
#include <storage/storage.h>
|
||||
#include <flipper_format/flipper_format_i.h>
|
||||
|
||||
int playlist_count_playlist_items(Storage* storage, const char* file_path) {
|
||||
FlipperFormat* format = flipper_format_file_alloc(storage);
|
||||
if(!flipper_format_file_open_existing(format, file_path)) {
|
||||
return -1;
|
||||
}
|
||||
int count = 0;
|
||||
FuriString* data;
|
||||
data = furi_string_alloc();
|
||||
while(flipper_format_read_string(format, "sub", data)) {
|
||||
++count;
|
||||
}
|
||||
flipper_format_file_close(format);
|
||||
flipper_format_free(format);
|
||||
furi_string_free(data);
|
||||
return count;
|
||||
}
|
||||
Reference in New Issue
Block a user