v0.0.3
Added
smfile_open/smfile_close— open and close a smart file in read/write modesmfile_cleanup— release all on-disk resources associated with a file pathsmfile_new_context— create an independent transaction context from an existing smart filesmfile_strerror/smfile_perror— error introspection in the style of the C standard library
Simple API — treats the file as a flat byte sequence:
smfile_size— query total file size in bytessmfile_read— read elements from a byte offsetsmfile_write— overwrite elements at a byte offset (atomic)smfile_insert— insert bytes into the middle of a filesmfile_remove— remove elements and close the gap (atomic, with optional capture)smfile_delete— delete a named variable
Power API — named variables and strided element access:
smfile_psize— query the size of a named variablesmfile_pread— strided read from a named variablesmfile_pwrite— strided write into a named variablesmfile_pinsert— insert into a named variable at a byte offsetsmfile_premove— strided remove from a named variable (atomic, with optional capture)
Transactions — WAL-backed, two-phase locking:
smfile_begin— begin an explicit transactionsmfile_commit— commit all operations as a single atomic unitsmfile_rollback— undo all mutations since the lastsmfile_begin
Notes
- All simple and power operations are individually atomic by default
- Explicit transactions promote a sequence of operations to a single atomic unit
- Negative byte offsets are interpreted relative to end of file
- Explicit-width types used throughout for deterministic on-disk layout
Full Changelog: v0.0.2...v0.0.3