CringeDB/File-Page Abstraction/cdb_file-page.h

16 lines
756 B
C
Raw Normal View History

2022-08-29 11:05:24 +02:00
typedef struct fp_File_impl * fp_File;
//Creates a new file, opens it, and resizes it to the specified page size
fp_File fp_fileNew(char * fileName, unsigned long pageSize); //there shouldn't be a page, longer than 4gb
fp_File fp_fileTemp(char * fileName, unsigned long pageSize);
fp_File fp_fileOpen(char * fileName);
//Since someone else has to read the header, this function sets the read page size after fp_fileOpen has been called
void fp_fileSetPageSize(fp_File file, unsigned long pageSize);
//negative values indicate the removable of the latest pages; so this library doesn't need more functions
void * fp_fileAppendPages(fp_File file, long numberOfPages);
void * fp_fileToMemroy(fp_File file);
void fp_fileClose(fp_File file);