Simple RAM file system.

Dependents:   modem_ref_helper

ram_fs.h

Committer:
Jeej
Date:
21 months ago
Revision:
5:d2b8d685f86f
Parent:
0:befc17558de9

File content as of revision 5:d2b8d685f86f:

#ifndef _FS_H_
#define _FS_H_

#include "mbed.h"

typedef struct {
    uint8_t file_id;
    uint8_t* header;
    uint8_t* data;
    void* next;
} ram_fs_file_t;

void ram_fs_new(uint8_t file_id, uint8_t* header, uint8_t* data);
bool ram_fs_delete(uint8_t file_id);
bool ram_fs_write(uint8_t file_id, uint16_t offset, uint16_t size, uint8_t* content);
bool ram_fs_read(uint8_t file_id, uint16_t offset, uint16_t size, uint8_t* buf);
void* ram_fs_get_header(uint8_t file_id);
void* ram_fs_get_data(uint8_t file_id);

#endif // _FS_H_