#ifndef MEMFILE_HPP #define MEMFILE_HPP #include #include #include "errors.hpp" struct memfile { int fd = 0; std::string map; unsigned long tree = 0; FILE *fp = NULL; // Read by checkdisk() from other threads while the owning reader thread appends std::atomic off{0}; }; struct memfile *memfile_open(int fd); int memfile_close(struct memfile *file); int memfile_write(struct memfile *file, void *s, long long len, bool &in_memory); void memfile_full(struct memfile *file); #endif