1/* @ajax/mesh-fleet-store: the member's fleet state file (`--fleet-state`): its term, vote and the
2 * documents (mesh-fleet-persist), written whole to a temp file, synced, renamed into place and the
3 * directory synced, before any vote, acknowledgement or commit leaves this member. */
4#ifndef MESH_FLEET_STORE_H
5#define MESH_FLEET_STORE_H
67#include "mesh/fleet_persist.h"
89#include <stdbool.h>
10#include <stdint.h>
1112typedef struct {
13 char *path;
14 uint32_t n;
15} mfs_store;
1617/* Opens the file (absent: a fresh member) and writes it back at once (so the directory is writable
18 * before the first vote). On error *err says which file and why. */
19bool mfs_open(const char *path, uint32_t n, mfs_store *out, mfp_persist *p, char **err);
20bool mfs_write(const mfs_store *s, const mfp_persist *p, char **err);
21void mfs_close(mfs_store *s);
2223#endif