-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapdu_log.h
63 lines (52 loc) · 1.28 KB
/
apdu_log.h
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
#pragma once
#include <flipper_format/flipper_format.h>
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
APDULogModeOpenExisting,
APDULogModeOpenAlways,
} APDULogMode;
typedef struct APDULog APDULog;
/** Check if the file list exists
*
* @param path - list path
*
* @return true if list exists, false otherwise
*/
bool apdu_log_check_presence(const char* path);
/** Open or create list
* Depending on mode, list will be opened or created.
*
* @param path - Path of the file that contain the list
* @param mode - ListKeysMode value
*
* @return Returns APDULog list instance
*/
APDULog* apdu_log_alloc(const char* path, APDULogMode mode);
/** Close list
*
* @param instance - APDULog list instance
*/
void apdu_log_free(APDULog* instance);
/** Get total number of lines in list
*
* @param instance - APDULog list instance
*
* @return Returns total number of lines in list
*/
size_t apdu_log_get_total_lines(APDULog* instance);
/** Rewind list
*
* @param instance - APDULog list instance
*
* @return Returns true if rewind was successful, false otherwise
*/
bool apdu_log_rewind(APDULog* instance);
bool apdu_log_get_next_log_str(APDULog* instance, FuriString* log);
#ifdef __cplusplus
}
#endif