mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-23 19:23:09 +00:00
4bf29827f8
* Quicksave 1 * Header stage complete * Source stage complete * Lint & merge fixes * Includes * Documentation step 1 * FBT: output free size considering BT STACK * Documentation step 2 * py lint * Fix music player plugin * unit test stage 1: string allocator, mem, getters, setters, appends, compare, search. * unit test: string equality * unit test: string replace * unit test: string start_with, end_with * unit test: string trim * unit test: utf-8 * Rename * Revert fw_size changes * Simplify CLI backspace handling * Simplify CLI character insert * Merge fixes * Furi: correct filenaming and spelling * Bt: remove furi string include Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
57 lines
No EOL
1.4 KiB
C
57 lines
No EOL
1.4 KiB
C
#pragma once
|
|
|
|
#include <storage/storage.h>
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
ResourceManifestEntryTypeUnknown = 0,
|
|
ResourceManifestEntryTypeDirectory,
|
|
ResourceManifestEntryTypeFile,
|
|
} ResourceManifestEntryType;
|
|
|
|
typedef struct {
|
|
ResourceManifestEntryType type;
|
|
FuriString* name;
|
|
uint32_t size;
|
|
uint8_t hash[16];
|
|
} ResourceManifestEntry;
|
|
|
|
typedef struct ResourceManifestReader ResourceManifestReader;
|
|
|
|
/**
|
|
* @brief Initialize resource manifest reader
|
|
* @param storage Storage API pointer
|
|
* @return allocated object
|
|
*/
|
|
ResourceManifestReader* resource_manifest_reader_alloc(Storage* storage);
|
|
|
|
/**
|
|
* @brief Release resource manifest reader
|
|
* @param resource_manifest allocated object
|
|
*/
|
|
void resource_manifest_reader_free(ResourceManifestReader* resource_manifest);
|
|
|
|
/**
|
|
* @brief Initialize resource manifest reader iteration
|
|
* @param resource_manifest allocated object
|
|
* @param filename manifest file name
|
|
* @return true if file opened
|
|
*/
|
|
bool resource_manifest_reader_open(ResourceManifestReader* resource_manifest, const char* filename);
|
|
|
|
/**
|
|
* @brief Read next file/dir entry from manifest
|
|
* @param resource_manifest allocated object
|
|
* @return entry or NULL if end of file
|
|
*/
|
|
ResourceManifestEntry* resource_manifest_reader_next(ResourceManifestReader* resource_manifest);
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif |