Обновление
This commit is contained in:
commit
016d9ff6d7
|
|
@ -0,0 +1,32 @@
|
|||
//
|
||||
// Created by cfif on 07.10.22.
|
||||
//
|
||||
|
||||
#ifndef MODULE_STORAGEIO_H
|
||||
#define MODULE_STORAGEIO_H
|
||||
|
||||
#include "stdint.h"
|
||||
#include "stddef.h"
|
||||
|
||||
typedef enum {
|
||||
STORAGE_OK = 0,
|
||||
STORAGE_ERR_DATA = 1,
|
||||
STORAGE_ERR_DEVICE = 2,
|
||||
} eStorageStatus;
|
||||
|
||||
typedef eStorageStatus (*StorageIOTransaction )(void *env, void *mem, size_t size);
|
||||
|
||||
typedef struct {
|
||||
void *env;
|
||||
StorageIOTransaction load;
|
||||
StorageIOTransaction dump;
|
||||
} tStorageInterface;
|
||||
|
||||
#define StorageDump(STORAGE, MEM, SIZE) (STORAGE)->dump((STORAGE)->env, MEM, SIZE)
|
||||
#define StorageLoad(STORAGE, MEM, SIZE) (STORAGE)->load((STORAGE)->env, MEM, SIZE)
|
||||
|
||||
#define StorageDumpStatic(STORAGE, MEM) (STORAGE)->dump((STORAGE)->env, &(MEM), sizeof(MEM))
|
||||
#define StorageLoadStatic(STORAGE, MEM) (STORAGE)->load((STORAGE)->env, &(MEM), sizeof(MEM))
|
||||
|
||||
|
||||
#endif //MODULE_STORAGEIO_H
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"cmake": {
|
||||
"inc_dirs": [
|
||||
"Inc"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue