Welcome to mirror list, hosted at ThFree Co, Russian Federation.

flipper_file_i.h « flipper_file « lib - github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 585f0b853441312ce5f1b26a5dc4a6912e1f4eb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <stdint.h>
#include <storage/storage.h>

struct FlipperFile {
    File* file;
    Storage* storage;
    bool strict_mode;
};

/**
 *  Value write type callback
 */
typedef bool (*flipper_file_cb)(File* file, const char* key, const void* data, uint16_t data_size);

/**
 * 
 * @param flipper_file 
 * @param key 
 * @param cb 
 * @param cb_key 
 * @param cb_data 
 * @param cb_data_size 
 * @return bool 
 */
bool flipper_file_delete_key_and_call(
    FlipperFile* flipper_file,
    const char* key,
    flipper_file_cb cb,
    const char* cb_key,
    const void* cb_data,
    const uint16_t cb_data_size);

/**
 * Value types
 */
typedef enum {
    FlipperFileValueHex,
    FlipperFileValueFloat,
    FlipperFileValueInt32,
    FlipperFileValueUint32,
} FlipperFileValueType;

/**
 * Internal write values function
 * @param file 
 * @param key 
 * @param _data 
 * @param data_size 
 * @param type 
 * @return bool 
 */
bool flipper_file_write_internal(
    File* file,
    const char* key,
    const void* _data,
    const uint16_t data_size,
    FlipperFileValueType type);

/**
 * Internal read values function
 * @param file 
 * @param key 
 * @param _data 
 * @param data_size 
 * @param type 
 * @return bool 
 */
bool flipper_file_read_internal(
    File* file,
    const char* key,
    void* _data,
    const uint16_t data_size,
    bool strict_mode,
    FlipperFileValueType type);