ringfs
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
ringfs.h File Reference
#include <stdint.h>
#include <unistd.h>

Go to the source code of this file.

Data Structures

struct  ringfs_flash_partition
 Flash memory+parition descriptor. More...
 
struct  ringfs
 RingFS instance. More...
 

Functions

int ringfs_init (struct ringfs *fs, const struct ringfs_flash_partition *flash, uint32_t version, int object_size)
 Initialize a RingFS instance. More...
 
int ringfs_format (struct ringfs *fs)
 Format the flash memory. More...
 
int ringfs_scan (struct ringfs *fs)
 Scan the flash memory for a valid filesystem. More...
 
int ringfs_capacity (struct ringfs *fs)
 Calculate maximum RingFS capacity. More...
 
int ringfs_count_estimate (struct ringfs *fs)
 Calculate approximate object count. More...
 
int ringfs_count_exact (struct ringfs *fs)
 Calculate exact object count. More...
 
int ringfs_append (struct ringfs *fs, const void *object)
 Append an object at the end of the ring. More...
 
int ringfs_fetch (struct ringfs *fs, void *object)
 Fetch next object from the ring, oldest-first. More...
 
int ringfs_discard (struct ringfs *fs)
 Discard all fetched objects up to the read cursor. More...
 
int ringfs_rewind (struct ringfs *fs)
 Rewind the read cursor back to the oldest object. More...